Jelajahi Sumber

采购数据过滤、合同金额类型调整及页面展示优化、税前单价、税后单价及总价所涉及的多个页面的调整

ouyj 9 bulan lalu
induk
melakukan
c7407efd0d
31 mengubah file dengan 492 tambahan dan 132 penghapusan
  1. 25 20
      src/main/contract/com/yw/contract/contract/action/ContractEntryAction.java
  2. 2 1
      src/main/contract/com/yw/contract/contract/action/ContractMoneyStatAction.java
  3. 6 6
      src/main/contract/com/yw/contract/contract/action/ContractMyLaunchAction.java
  4. 6 0
      src/main/contract/com/yw/contract/contract/action/PurchaseNoContractAction.java
  5. 2 2
      src/main/contract/com/yw/contract/contract/dao/ContractEntryDaoImpl.java
  6. 45 21
      src/main/contract/com/yw/contract/contract/dao/ContractListDaoImpl.java
  7. 1 0
      src/main/contract/com/yw/contract/contract/dao/ContractMaterialDaoImpl.java
  8. 1 1
      src/main/contract/com/yw/contract/contract/dao/ContractMoneyStatDaoImpl.java
  9. 9 6
      src/main/contract/com/yw/contract/contract/dao/ContractMyLaunchDaoImpl.java
  10. 17 2
      src/main/contract/com/yw/contract/contract/dao/ContractPurchaseDaoImpl.java
  11. 9 8
      src/main/contract/com/yw/contract/contract/model/ContractInfo.java
  12. 12 0
      src/main/contract/com/yw/contract/contract/model/ContractMaterial.java
  13. 11 1
      src/main/contract/com/yw/contract/contract/model/ContractPurchaseOrderDetail.java
  14. 72 0
      src/main/webapp/yw/contract/contractFlowCustom/js/contract.js
  15. 40 5
      src/main/webapp/yw/contract/contractFlowCustom/processContract.jsp
  16. 38 5
      src/main/webapp/yw/contract/contractFlowCustom/startContract.jsp
  17. 7 3
      src/main/webapp/yw/contract/contractFlowCustom/viewContract.jsp
  18. 19 8
      src/main/webapp/yw/contract/contractPurchaseOrder/createPurchaseOrder.jsp
  19. 17 6
      src/main/webapp/yw/contract/contractPurchaseOrder/editPurchaseOrder.jsp
  20. 8 4
      src/main/webapp/yw/contract/contractPurchaseOrder/infoPurchaseOrder.jsp
  21. 57 4
      src/main/webapp/yw/contract/contractPurchaseOrder/js/purchaseOrder.js
  22. 4 0
      src/main/webapp/yw/contract/purchaseNoContract/selectContractPurchase.jsp
  23. 6 1
      src/main/webapp/yw/contract/selectContractMaterial.jsp
  24. 10 4
      src/main/webapp/yw/contract/selectMaterialForContract.jsp
  25. 2 1
      src/main/webapp/yw/contract/viewContractEntryInfo.jsp
  26. 11 3
      src/main/webapp/yw/contract/viewContractStatus.jsp
  27. 14 5
      src/main/webapp/yw/master1_contract/contractPurchaseOrder/createPurchaseOrder.jsp
  28. 19 6
      src/main/webapp/yw/master1_contract/contractPurchaseOrder/editPurchaseOrder.jsp
  29. 8 4
      src/main/webapp/yw/master1_contract/contractPurchaseOrder/infoPurchaseOrder.jsp
  30. 3 2
      src/main/webapp/yw/master1_contract/viewContractSearch.jsp
  31. 11 3
      src/main/webapp/yw/master1_contract/viewContractStatus.jsp

+ 25 - 20
src/main/contract/com/yw/contract/contract/action/ContractEntryAction.java

@@ -2,6 +2,7 @@ package com.yw.contract.contract.action;
 
 import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
 import java.net.URLDecoder;
 import java.text.DecimalFormat;
 import java.util.ArrayList;
@@ -134,10 +135,10 @@ public class ContractEntryAction extends ContractFlowAction {
 		info.setContract_type(Long.valueOf(request.getParameter("contract_type")));
 		info.setWarranty_period(request.getParameter("warranty_period"));
 		if (StringUtils.isNotEmpty(request.getParameter("contract_money"))) {
-			info.setContract_money(Double.valueOf(request.getParameter("contract_money")));
+			info.setContract_money(new BigDecimal(request.getParameter("contract_money")));
 		}
 		if (StringUtils.isNotEmpty(request.getParameter("contract_gold"))) {
-			info.setContract_gold(Double.valueOf(request.getParameter("contract_gold")));
+			info.setContract_gold(new BigDecimal(request.getParameter("contract_gold")));
 		}
 		info.setContract_signdate(DateUtil.stringToDate(request.getParameter("contract_signdate"), Constant.DATE_FORMATE));
 		if (Long.valueOf(request.getParameter("salesman")) < 0) {
@@ -257,7 +258,7 @@ public class ContractEntryAction extends ContractFlowAction {
 		contractEntryService = (ContractEntryService) cxt.getBean("contractEntryService");
 		ContractInfo info = new ContractInfo();
 		Long contractId = Long.valueOf(request.getParameter("id"));
-		DecimalFormat df = new DecimalFormat("0.00");
+		//DecimalFormat df = new DecimalFormat("0.00");
 		try {
 			List<ContractInfo> infoList = new ArrayList<ContractInfo>();
 			String key = ContractConstant.CONTRACT_TYPE;
@@ -267,8 +268,10 @@ public class ContractEntryAction extends ContractFlowAction {
 			}
 			info = contractEntryService.toEditContractEntry(contractId, oasession);
 			if (info != null) {
-				info.setContract_money_string(df.format(info.getContract_money()));
-				info.setContract_gold_string(df.format(info.getContract_gold()));
+				/*info.setContract_money_string(df.format(info.getContract_money()));
+				info.setContract_gold_string(df.format(info.getContract_gold()));*/
+				info.setContract_money_string(ObjectUtils.isEmpty(info.getContract_money())==true?"":info.getContract_money().stripTrailingZeros().toPlainString());
+				info.setContract_gold_string(ObjectUtils.isEmpty(info.getContract_gold())==true?"":info.getContract_gold().stripTrailingZeros().toPlainString());
 				request.setAttribute("contractInfo", info);
 			} else {
 				this.addError("获取数据失败");
@@ -433,11 +436,11 @@ public class ContractEntryAction extends ContractFlowAction {
 			info.setContract_name(java.net.URLDecoder.decode(request.getParameter("contract_name"), "UTF-8"));
 			info.setContract_type(StringUtil.strToLong(request.getParameter("contract_type")));
 			info.setWarranty_period(java.net.URLDecoder.decode(request.getParameter("warranty_period"), "UTF-8"));
-			if (!"".equals(request.getParameter("contract_money"))) {
-				info.setContract_money(StringUtil.strToDouble(request.getParameter("")));
+			if (StringUtils.isNotEmpty(request.getParameter("contract_money"))) {
+				info.setContract_money(new BigDecimal(request.getParameter("contract_money")));
 			}
-			if (!"".equals(request.getParameter("contract_gold"))) {
-				info.setContract_gold(StringUtil.strToDouble(request.getParameter("contract_gold")));
+			if (StringUtils.isNotEmpty(request.getParameter("contract_gold"))) {
+				info.setContract_gold(new BigDecimal(request.getParameter("contract_gold")));
 			}
 			info.setContract_signdate(DateUtil.stringToDate(request.getParameter("contract_signdate"), Constant.DATE_FORMATE));
 			info.setSalesman(-StringUtil.strToLong(request.getParameter("salesman")));
@@ -595,9 +598,9 @@ public class ContractEntryAction extends ContractFlowAction {
 			relationList = contractEntryService.relationContractList(contractId);
 			request.setAttribute("relationList", relationList);
 			if (info != null) {
-				DecimalFormat df = new DecimalFormat("0.00");
-				info.setContract_money_string(df.format(info.getContract_money()));
-				info.setContract_gold_string(df.format(info.getContract_gold()));
+				//DecimalFormat df = new DecimalFormat("0.00");
+				info.setContract_money_string(ObjectUtils.isEmpty(info.getContract_money())==true?"":info.getContract_money().stripTrailingZeros().toPlainString());
+				info.setContract_gold_string(ObjectUtils.isEmpty(info.getContract_gold())==true?"":info.getContract_gold().stripTrailingZeros().toPlainString());
 				request.setAttribute("contractInfo", info);
 				String main_accessory=info.getMain_accessory()==null?"":info.getMain_accessory();
 				String[] strs = main_accessory.split(",");
@@ -658,17 +661,17 @@ public class ContractEntryAction extends ContractFlowAction {
 		info.setContract_name(request.getParameter("contract_name"));
 		info.setContract_type(Long.valueOf(request.getParameter("contract_type")));
 		info.setWarranty_period(request.getParameter("warranty_period"));
-		if (!"".equals(request.getParameter("contract_money"))) {
+		if (StringUtils.isNotEmpty(request.getParameter("contract_money"))) {
 			// 长期合作合同 时 传null linww 20150318 begin
 			String money = request.getParameter("contract_money");
 			if (money == null) {
 				money = "0.00";
 			}
-			info.setContract_money(Double.valueOf(money));
+			info.setContract_money(new BigDecimal(money));
 			// 长期合作合同 时 传null linww 20150318 end
 		}
 		if (StringUtils.isNotEmpty(request.getParameter("contract_gold"))) {
-			info.setContract_gold(Double.valueOf(request.getParameter("contract_gold")));
+			info.setContract_gold(new BigDecimal(request.getParameter("contract_gold")));
 		}
 		info.setContract_signdate(DateUtil.stringToDate(request.getParameter("contract_signdate"), Constant.DATE_FORMATE));
 		if (Long.valueOf(request.getParameter("salesman")) < 0) {
@@ -779,7 +782,7 @@ public class ContractEntryAction extends ContractFlowAction {
 		contractEntryService = (ContractEntryService) cxt.getBean("contractEntryService");
 		ContractInfo info = new ContractInfo();
 		Long contractId = Long.valueOf(request.getParameter("id"));
-		DecimalFormat df = new DecimalFormat("0.00");
+		//DecimalFormat df = new DecimalFormat("0.00");
 		try {
 			List<ContractInfo> infoList = new ArrayList<ContractInfo>();
 			String key = ContractConstant.CONTRACT_TYPE;
@@ -789,8 +792,10 @@ public class ContractEntryAction extends ContractFlowAction {
 			}
 			info = contractEntryService.toEditContractEntry(contractId, oasession);
 			if (info != null) {
-				info.setContract_money_string(df.format(info.getContract_money()));
-				info.setContract_gold_string(df.format(info.getContract_gold()));
+				/*info.setContract_money_string(df.format(info.getContract_money()));
+				info.setContract_gold_string(df.format(info.getContract_gold()));*/
+				info.setContract_money_string(ObjectUtils.isEmpty(info.getContract_money())==true?"":info.getContract_money().stripTrailingZeros().toPlainString());
+				info.setContract_gold_string(ObjectUtils.isEmpty(info.getContract_gold())==true?"":info.getContract_gold().stripTrailingZeros().toPlainString());
 				request.setAttribute("contractInfo", info);
 			} else {
 				this.addError("获取数据失败");
@@ -846,10 +851,10 @@ public class ContractEntryAction extends ContractFlowAction {
 		}
 		info.setWarranty_period(request.getParameter("warranty_period"));
 		if (StringUtils.isNotEmpty(request.getParameter("contract_money"))) {
-			info.setContract_money(Double.valueOf(request.getParameter("contract_money")));
+			info.setContract_money(new BigDecimal(request.getParameter("contract_money")));
 		}
 		if (StringUtils.isNotEmpty(request.getParameter("contract_gold"))) {
-			info.setContract_gold(Double.valueOf(request.getParameter("contract_gold")));
+			info.setContract_gold(new BigDecimal(request.getParameter("contract_gold")));
 		}
 		info.setContract_signdate(DateUtil.stringToDate(request.getParameter("contract_signdate"), Constant.DATE_FORMATE));
 		info.setSalesman(-Long.valueOf(request.getParameter("salesman")));

+ 2 - 1
src/main/contract/com/yw/contract/contract/action/ContractMoneyStatAction.java

@@ -1,5 +1,6 @@
 package com.yw.contract.contract.action;
 
+import java.math.BigDecimal;
 import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -110,7 +111,7 @@ public class ContractMoneyStatAction extends PermitDataAction{
 		}
 		return "/yw/contract/toContractStat.jsp";
 	}
-	private  Double formatAmount(Double count, int i) {
+	private  Double formatAmount(BigDecimal count, int i) {
 		String at = String.format("%." + i + "f", count);
 		return Double.valueOf(at);
 	}

+ 6 - 6
src/main/contract/com/yw/contract/contract/action/ContractMyLaunchAction.java

@@ -754,12 +754,12 @@ public class ContractMyLaunchAction extends PermitDataAction{
 					request.setAttribute("contractPurchaseDetailList", contractPurchaseDetailList);
 				}
 				Map<String,Object> overviewMap = new HashMap<String, Object>(); 
-				overviewMap.put("priceTotalContract", priceTotalContract.stripTrailingZeros());
-				overviewMap.put("qtyTotalContract", qtyTotalContract);
-				overviewMap.put("amountTotalPay", amountTotalPay.stripTrailingZeros());
-				overviewMap.put("qtyTotalUnIn", qtyTotalUnIn);
-				overviewMap.put("qtyTotalIn", qtyTotalIn);
-				overviewMap.put("amountRemain", amountRemain.stripTrailingZeros());
+				overviewMap.put("priceTotalContract", priceTotalContract.stripTrailingZeros().toPlainString());
+				overviewMap.put("qtyTotalContract", qtyTotalContract.stripTrailingZeros().toPlainString());
+				overviewMap.put("amountTotalPay", amountTotalPay.stripTrailingZeros().toPlainString());
+				overviewMap.put("qtyTotalUnIn", qtyTotalUnIn.stripTrailingZeros().toPlainString());
+				overviewMap.put("qtyTotalIn", qtyTotalIn.stripTrailingZeros().toPlainString());
+				overviewMap.put("amountRemain", amountRemain.stripTrailingZeros().toPlainString());
 				request.setAttribute("contractPurchaseOrders", contractPurchaseOrders);
 				request.setAttribute("inStockList", inStockList);
 				request.setAttribute("payList", payList);

+ 6 - 0
src/main/contract/com/yw/contract/contract/action/PurchaseNoContractAction.java

@@ -339,6 +339,8 @@ public class PurchaseNoContractAction  extends BpmBaseAction {
 	}
 	
 	private String toList(HttpServletRequest request, HttpServletResponse response) {
+		String noContract = request.getParameter("noContract");
+		request.setAttribute("noContract", noContract);
 		return "/yw/contract/purchaseNoContract/contractPurchaseList.jsp";
 	}
 	
@@ -351,6 +353,7 @@ public class PurchaseNoContractAction  extends BpmBaseAction {
 		String contractPurchaseName = request.getParameter("contractPurchaseName"); 
 		String contractNumber = request.getParameter("contractNumber");
 		String contractName = request.getParameter("contractName"); 
+		String noContract = request.getParameter("noContract");
 
 		List<ContractPurchaseForm> infoList = new ArrayList<ContractPurchaseForm>();
 		ContractPurchaseForm contractPurchaseForm = new ContractPurchaseForm();
@@ -377,6 +380,9 @@ public class PurchaseNoContractAction  extends BpmBaseAction {
 				contractName = java.net.URLDecoder.decode(contractName, "UTF-8");
 				ph.setParam("contractName",  contractName);
 			} 
+			if (noContract != null && !"".equals(noContract)) { 
+				ph.setParam("noContract", noContract.trim());
+			}
 			ph.setParam("unitId", oasession.getUnit().getId());
 			infoList = contractPurchaseService.contractPurchaseList(p, pSize, ph, contractPurchaseForm); 
 			int total = contractPurchaseService.countContractPurchase(ph);

+ 2 - 2
src/main/contract/com/yw/contract/contract/dao/ContractEntryDaoImpl.java

@@ -260,8 +260,8 @@ public class ContractEntryDaoImpl extends BaseDao implements ContractEntryDao {
 				info.setContract_name(rs.getString("contract_name"));
 				info.setContract_type(rs.getLong("contract_type"));
 				info.setWarranty_period(rs.getString("warranty_period"));
-				info.setContract_money(rs.getDouble("contract_money"));
-				info.setContract_gold(rs.getDouble("contract_gold"));
+				info.setContract_money(rs.getBigDecimal("contract_money"));
+				info.setContract_gold(rs.getBigDecimal("contract_gold"));
 				info.setContract_signdate(rs.getDate("contract_signdate"));
 				info.setSalesman(rs.getLong("salesman"));
 				info.setDuty_department(rs.getLong("duty_department"));

+ 45 - 21
src/main/contract/com/yw/contract/contract/dao/ContractListDaoImpl.java

@@ -23,12 +23,21 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
 	public List<ContractInfo> contractMyLaunchList(int p, int pSize, List<String> params, ContractInfo info, IAppSession oasession) throws Exception {
 		/*String sql = "SELECT ec.universalid, ec.contract_number,ec.contract_name,ec.contract_type,ec.contract_signdate," + "ec.contract_type,tu1.name AS duty_man_name,tu2.name AS salesman_name,"
 				+ "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name, ec.au_state, ec.flow_id, ec.execute_state ,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,ec.process_id,ec.contract_entrying_date "*/
-		String sql = "SELECT ec.*,tu1.name AS duty_man_name,tu2.name AS salesman_name,tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
+		/*String sql = "SELECT ec.*,tu1.name AS duty_man_name,tu2.name AS salesman_name,tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
 				+ "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID "
 				+ "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID " + "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID "
 				+ "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue " + "WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.contract_type LIKE ? "
 				+ "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ?  AND group_root_id=" + oasession.getUnit().getId() + ")  AND ed.is_valid = '1' "
-				+ "AND ec.contract_status='0' AND ec.duty_man LIKE ?  AND ec.isdraft = '0' " + "AND ec.unit_id=" + oasession.getUnit().getId() + " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";
+				+ "AND ec.contract_status='0' AND ec.duty_man LIKE ?  AND ec.isdraft = '0' " + "AND ec.unit_id=" + oasession.getUnit().getId() + " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";*/
+		String sql = "SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
+				+ " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
+				+ " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
+				+ " tu1.name AS duty_man_name,tu2.name AS salesman_name,tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
+				+ " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID "
+				+ " LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID " + "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID "
+				+ " LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue " + "WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.contract_type LIKE ? "
+				+ " AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ?  AND group_root_id=" + oasession.getUnit().getId() + ")  AND ed.is_valid = '1' "
+				+ " AND ec.contract_status='0' AND ec.duty_man LIKE ?  AND ec.isdraft = '0' " + "AND ec.unit_id=" + oasession.getUnit().getId() + " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";
 		return getPagerService().queryForObject(p, pSize, sql, params, info);
 	}
 
@@ -41,14 +50,16 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
 
 	@Override
 	public List<ContractInfo> contractMyDepartmentList(int n_p, int n_pSize, List<String> params, ContractInfo info, IAppSession oasession) throws Exception {
-		String sql = "SELECT ec.*,tu1.name AS duty_man_name,tu2.name AS salesman_name," 
-				+ "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
+		String sql = "SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
+				+ " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
+				+ " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
+				+ " tu1.name AS duty_man_name,tu2.name AS salesman_name, tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
 				//+" ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,ec.process_id,ec.contract_entrying_date "
-				+ "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " 
-				+ "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
-				+ "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
-				+ "WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.firstparty_name LIKE ? AND ec.secondparty_name LIKE ?  AND ec.contract_type LIKE ? "
-				+ "AND date_format(IFNULL(ec.contract_startdate,  '0000-00-00'),'%Y') LIKE ? " + "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ?  AND group_root_id="
+				+ " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " 
+				+ " LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
+				+ " LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
+				+ " WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.firstparty_name LIKE ? AND ec.secondparty_name LIKE ?  AND ec.contract_type LIKE ? "
+				+ " AND date_format(IFNULL(ec.contract_startdate,  '0000-00-00'),'%Y') LIKE ? " + "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ?  AND group_root_id="
 				+ oasession.getUnit().getId() + ")  AND ed.is_valid = '1' " + "AND ec.contract_status='0' AND ec.duty_department LIKE ?  AND ec.isdraft = '0' " + "AND ec.unit_id="
 				+ oasession.getUnit().getId() + " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";
 		return getPagerService().queryForObject(n_p, n_pSize, sql, params, info);
@@ -67,13 +78,15 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
 
 	@Override
 	public List<ContractInfo> contractMyCompanyList(int n_p, int n_pSize, List<String> params, ContractInfo info, IAppSession oasession) throws Exception {
-		String sql = "SELECT ec.*,tu1.name AS duty_man_name,tu2.name AS salesman_name," 
-				+ "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
+		String sql = "SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
+				+ " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
+				+ " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
+				+ " tu1.name AS duty_man_name,tu2.name AS salesman_name, tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
 				//+ " ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,ec.process_id,ec.contract_entrying_date "
-				+ "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
-				+ "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
-				+ "WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ?  AND ec.firstparty_name LIKE ? AND ec.secondparty_name LIKE ?  AND ec.contract_type LIKE ? "
-				+ "AND date_format(IFNULL(ec.contract_startdate,  '0000-00-00'),'%Y') LIKE ? " + "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ? AND group_root_id="
+				+ " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
+				+ " LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
+				+ " WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ?  AND ec.firstparty_name LIKE ? AND ec.secondparty_name LIKE ?  AND ec.contract_type LIKE ? "
+				+ " AND date_format(IFNULL(ec.contract_startdate,  '0000-00-00'),'%Y') LIKE ? " + "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ? AND group_root_id="
 				+ oasession.getUnit().getId() + " )  AND ed.is_valid = '1' " + "AND ec.contract_status='0'  AND ec.isdraft = '0' " + "AND ec.unit_id=" + oasession.getUnit().getId()
 				+ " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";
 		return getPagerService().queryForObject(n_p, n_pSize, sql, params, info);
@@ -95,10 +108,18 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
 		/*StringBuffer bf = new StringBuffer("SELECT ec.universalid, ec.contract_number,ec.contract_name,ec.contract_type,ec.contract_signdate,"
 				+ "ec.contract_type,tu1.name AS duty_man_name,tu2.name AS salesman_name," + "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name, ec.au_state, ec.flow_id, ec.execute_state, "
 				+ " ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,ec.process_id,ec.contract_entrying_date "*/
-		StringBuffer bf = new StringBuffer("SELECT ec.*, tu1.name AS duty_man_name,tu2.name AS salesman_name, tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name  " 
+		/*StringBuffer bf = new StringBuffer("SELECT ec.*, tu1.name AS duty_man_name,tu2.name AS salesman_name, tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name  " 
 				+ "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
 				+ "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
 				+ "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = '" + ph.getParam("dic_contract_type") + "' AND group_root_id=" + ph.getParam("unit_id")
+				+ " )  AND ed.is_valid = '1' " + "WHERE 1=1 AND ec.contract_status='0'  AND ec.isdraft = '0' ");*/
+		StringBuffer bf = new StringBuffer("SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
+				+ " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
+				+ " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
+				+ " tu1.name AS duty_man_name,tu2.name AS salesman_name,tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name  " 
+				+ " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
+				+ " LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
+				+ " AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = '" + ph.getParam("dic_contract_type") + "' AND group_root_id=" + ph.getParam("unit_id")
 				+ " )  AND ed.is_valid = '1' " + "WHERE 1=1 AND ec.contract_status='0'  AND ec.isdraft = '0' ");
 		bf.append(whereListSql(ph));
 		return getPagerService().queryForObject(n_p, n_pSize, bf.toString(), info);
@@ -149,10 +170,13 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
 	@Override
 	public List<ContractInfo> excelContractList(ParameterHelper ph) throws Exception {
 		StringBuffer bf = new StringBuffer();
-		String sql = "SELECT ec.*,tu1.name AS duty_man_name,tu2.name AS salesman_name," + "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
-				+ "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
-				+ "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
-				+ "WHERE 1=1 AND ec.contract_status='0' AND ec.isdraft = '0' ";
+		String sql = "SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
+				+ " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
+				+ " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
+				+ " tu1.name AS duty_man_name,tu2.name AS salesman_name," + "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
+				+ " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
+				+ " LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
+				+ " WHERE 1=1 AND ec.contract_status='0' AND ec.isdraft = '0' ";
 		bf.append(sql);
 		bf.append(this.excelWhereSql(ph));
 		bf.append(" ORDER BY ec.contract_signdate DESC ");
@@ -164,7 +188,7 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
 				info.setContract_number(rs.getString("contract_number"));
 				info.setContract_name(rs.getString("contract_name"));
 				info.setContract_signdate(rs.getDate("contract_signdate"));
-				info.setContract_money(rs.getDouble("contract_money"));
+				info.setContract_money(rs.getBigDecimal("contract_money"));
 				info.setPayment_method(rs.getString("payment_method"));
 				info.setWarranty_period(rs.getString("warranty_period"));
 				DecimalFormat df = new DecimalFormat("0.00");

+ 1 - 0
src/main/contract/com/yw/contract/contract/dao/ContractMaterialDaoImpl.java

@@ -54,6 +54,7 @@ public class ContractMaterialDaoImpl extends BaseDao implements ContractMaterial
 				material.setPrice(rs.getBigDecimal("price"));
 				material.setQty(rs.getBigDecimal("qty"));
 				material.setCess(rs.getBigDecimal("cess"));
+				material.setPriceTax(rs.getBigDecimal("price_tax"));
 				return material;
 			}
 		};

+ 1 - 1
src/main/contract/com/yw/contract/contract/dao/ContractMoneyStatDaoImpl.java

@@ -43,7 +43,7 @@ public class ContractMoneyStatDaoImpl extends BaseDao implements ContractMoneySt
 				info.setContract_name(rs.getString("contract_name"));
 				info.setContract_type(rs.getLong("contract_type"));
 				info.setWarranty_period(rs.getString("warranty_period"));
-				info.setContract_money(rs.getDouble("contract_money"));
+				info.setContract_money(rs.getBigDecimal("contract_money"));
 				info.setContract_signdate(rs.getDate("contract_signdate"));
 				info.setSalesman(rs.getLong("salesman"));
 				info.setDuty_department(rs.getLong("duty_department"));

+ 9 - 6
src/main/contract/com/yw/contract/contract/dao/ContractMyLaunchDaoImpl.java

@@ -26,12 +26,15 @@ public class ContractMyLaunchDaoImpl extends BaseDao implements ContractMyLaunch
 		/*String sql = "SELECT ec.universalid, ec.contract_number,ec.contract_name,ec.contract_type,ec.contract_signdate," + "ec.contract_type,tu1.name AS duty_man_name,tu2.name AS salesman_name,"
 				+ "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name, ec.au_state, ec.flow_id, ec.execute_state, " 
 				+ " ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,ec.process_id,ec.contract_entrying_date "*/
-		String sql = "SELECT ec.*, tu1.name AS duty_man_name,tu2.name AS salesman_name, tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "  
-				+ "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID "
-				+ "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID " + "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID "
-				+ "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue " + "WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.contract_type LIKE ? "
-				+ "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ? AND group_root_id=" + oasession.getUnit().getId() + ")  AND ed.is_valid = '1' "
-				+ "AND ec.contract_status='0' AND ec.salesman LIKE ?  AND ec.isdraft = '0' " + "AND ec.unit_id=" + oasession.getUnit().getId() + " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";
+		String sql = "SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
+				+ " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
+				+ " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
+				+ " tu1.name AS duty_man_name,tu2.name AS salesman_name, tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "  
+				+ " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID "
+				+ " LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID " + "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID "
+				+ " LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue " + "WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.contract_type LIKE ? "
+				+ " AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ? AND group_root_id=" + oasession.getUnit().getId() + ")  AND ed.is_valid = '1' "
+				+ " AND ec.contract_status='0' AND ec.salesman LIKE ?  AND ec.isdraft = '0' " + "AND ec.unit_id=" + oasession.getUnit().getId() + " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";
 		return getPagerService().queryForObject(p, pSize, sql, params, info);
 	}
 

+ 17 - 2
src/main/contract/com/yw/contract/contract/dao/ContractPurchaseDaoImpl.java

@@ -282,7 +282,10 @@ public class ContractPurchaseDaoImpl extends BaseDao implements ContractPurchase
 	@Override
 	public List<ContractPurchaseForm> contractPurchaseList(int n_p, int n_pSize, ParameterHelper ph,
 			ContractPurchaseForm contractPurchaseForm) throws Exception {
-		StringBuffer sb = new StringBuffer("SELECT t.*,a.v_ins_sub_name FROM contract_purchase_form t left join bpm_flow_instance a on a.l_ins_id = t.flow_ins_id WHERE 1=1 and t.is_valid=1 ");
+		StringBuffer sb = new StringBuffer("SELECT t.*,a.v_ins_sub_name FROM contract_purchase_form t "
+				+ " left join bpm_flow_instance a on a.l_ins_id = t.flow_ins_id "
+				+ " left join contract b on b.purchase_id = t.universalid "
+				+ " WHERE 1=1 and t.is_valid=1 ");
 		if (null != ph.getParam("processId") && !"".equals(ph.getParam("processId"))) {
 			sb.append(" AND t.process_id LIKE '%" + ph.getParam("processId") + "%'");
 		}
@@ -307,13 +310,20 @@ public class ContractPurchaseDaoImpl extends BaseDao implements ContractPurchase
 		if (null != ph.getParam("syncStatus") && !"".equals(ph.getParam("syncStatus"))) {
 			sb.append(" AND t.sync_status = '" + ph.getParam("syncStatus") + "'");
 		}
+		if (null != ph.getParam("noContract") && !"".equals(ph.getParam("noContract"))) {
+			if("true".equals(ph.getParam("noContract"))){
+				sb.append(" AND (b.universalid is null or (b.is_valid != 0 and b.is_valid != 1)) ");
+			} 
+		}
 		sb.append(" order by t.create_time desc "); 
 		return getPagerService().queryForObject(n_p, n_pSize, sb.toString(), contractPurchaseForm); 
 	}
 
 	@Override
 	public int countContractPurchase(ParameterHelper ph) throws Exception {
-		StringBuffer sb = new StringBuffer("SELECT count(*) FROM contract_purchase_form t WHERE 1=1  and t.is_valid=1 ");
+		StringBuffer sb = new StringBuffer("SELECT count(*) FROM contract_purchase_form t "
+				+ " left join contract b on b.purchase_id = t.universalid "
+				+ " WHERE 1=1  and t.is_valid=1 ");
 		if (null != ph.getParam("processId") && !"".equals(ph.getParam("processId"))) {
 			sb.append(" AND t.process_id LIKE '%" + ph.getParam("processId") + "%'");
 		}
@@ -338,6 +348,11 @@ public class ContractPurchaseDaoImpl extends BaseDao implements ContractPurchase
 		if (null != ph.getParam("syncStatus") && !"".equals(ph.getParam("syncStatus"))) {
 			sb.append(" AND t.sync_status = '" + ph.getParam("syncStatus") + "'");
 		}
+		if (null != ph.getParam("noContract") && !"".equals(ph.getParam("noContract"))) {
+			if("true".equals(ph.getParam("noContract"))){
+				sb.append(" AND (b.universalid is null or (b.is_valid != 0 and b.is_valid != 1)) ");
+			} 
+		}
 		return jdbcTemplate.queryForObject(sb.toString(), Integer.class);
 	}
 

+ 9 - 8
src/main/contract/com/yw/contract/contract/model/ContractInfo.java

@@ -1,5 +1,6 @@
 package com.yw.contract.contract.model;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -29,8 +30,8 @@ public class ContractInfo {
 	@Column(name="warranty_period",type=Types.VARCHAR)
 	private String warranty_period;		//合同有效期
 	
-	@Column(name="contract_money",type=Types.DOUBLE)
-	private Double contract_money;		//合同金额
+	@Column(name="contract_money",type=Types.DECIMAL)
+	private BigDecimal contract_money;		//合同金额
 	
 	@Column(name="contract_signdate",type=Types.DATE)
 	private Date contract_signdate;		//合同签订日期
@@ -110,8 +111,8 @@ public class ContractInfo {
 	@Column(name="project_code",type=Types.VARCHAR)
 	private String project_code;
 	
-	@Column(name="contract_gold",type=Types.DOUBLE)
-	private Double contract_gold;		//质保金
+	@Column(name="contract_gold",type=Types.DECIMAL)
+	private BigDecimal contract_gold;		//质保金
 	
 	@Column(name="contract_target ",type=Types.VARCHAR)
 	private String contract_target ;		//采购标的
@@ -371,10 +372,10 @@ public class ContractInfo {
 //	public void setContract_money(double contract_money) {
 //		this.contract_money = contract_money;
 //	}
-	public Double getContract_money() {
+	public BigDecimal getContract_money() {
 		return contract_money;
 	}
-	public void setContract_money(Double contract_money) {
+	public void setContract_money(BigDecimal contract_money) {
 		this.contract_money = contract_money;
 	}
 	public Date getContract_signdate() {
@@ -521,10 +522,10 @@ public class ContractInfo {
 	public void setProject_code(String project_code) {
 		this.project_code = project_code;
 	}
-	public Double getContract_gold() {
+	public BigDecimal getContract_gold() {
 		return contract_gold;
 	}
-	public void setContract_gold(Double contract_gold) {
+	public void setContract_gold(BigDecimal contract_gold) {
 		this.contract_gold = contract_gold;
 	}
 //	public String getContract_is_plan() {

+ 12 - 0
src/main/contract/com/yw/contract/contract/model/ContractMaterial.java

@@ -75,6 +75,10 @@ public class ContractMaterial {
     @Column(name = "l_form_ins_id", type = Types.BIGINT)
     private Long lFormInsId;
     
+    //税后单价
+    @Column(name="price_tax",type=Types.DECIMAL)
+    private BigDecimal priceTax;
+    
     public ContractMaterial(){
     	
     }
@@ -230,4 +234,12 @@ public class ContractMaterial {
 	public void setlFormInsId(Long lFormInsId) {
 		this.lFormInsId = lFormInsId;
 	}
+
+	public BigDecimal getPriceTax() {
+		return priceTax;
+	}
+
+	public void setPriceTax(BigDecimal priceTax) {
+		this.priceTax = priceTax;
+	}
 }

+ 11 - 1
src/main/contract/com/yw/contract/contract/model/ContractPurchaseOrderDetail.java

@@ -49,6 +49,10 @@ public class ContractPurchaseOrderDetail {
      
     @Column(name = "unit_id" ,type = Types.BIGINT)
 	private Long unitId;//单位ID
+    
+    //税后单价
+    @Column(name="price_tax",type=Types.DECIMAL)
+    private BigDecimal priceTax;
 
 	public Long getUniversalid() {
 		return universalid;
@@ -146,5 +150,11 @@ public class ContractPurchaseOrderDetail {
 		this.unitId = unitId;
 	}
     
-    
+	public BigDecimal getPriceTax() {
+		return priceTax;
+	}
+
+	public void setPriceTax(BigDecimal priceTax) {
+		this.priceTax = priceTax;
+	}
 }

+ 72 - 0
src/main/webapp/yw/contract/contractFlowCustom/js/contract.js

@@ -20,6 +20,7 @@
 		$(cloneObj).find("input.price").attr("name", "contractMaterialList[" + index + "].price").val(row.price || 0);
 		$(cloneObj).find("input.cess").attr("name", "contractMaterialList[" + index + "].cess").val(row.cess || 0); 
 		$(cloneObj).find("input.measureName").attr("name", "contractMaterialList[" + index + "].measureName").val(row.measureName);
+		$(cloneObj).find("input.priceTax").attr("name", "contractMaterialList[" + index + "].priceTax").val(row.priceTax || 0);
 		$("#firstPoint").before(cloneObj); 
 	}
 };
@@ -35,6 +36,7 @@ function addMaterialIdAndName() {
         $(v).find("input.price").attr("name", "contractMaterialList[" + i + "].price"); 
         $(v).find("input.cess").attr("name", "contractMaterialList[" + i + "].cess");  
         $(v).find("input.measureName").attr("name", "contractMaterialList[" + i + "].measureName");
+        $(v).find("input.priceTax").attr("name", "contractMaterialList[" + i + "].priceTax"); 
     }); 
 }
 
@@ -289,4 +291,74 @@ function addMaterialFromImport(materialStr) {
 		addMaterial(i, materialList[i]);
 	}
 	addMaterialIdAndName();
+}
+
+
+function calculatePrice(row) {
+    // 获取当前行的输入元素
+    var $row = $(row); // 转换为jQuery对象方便操作
+    var priceInput = $row.find('.price')[0];
+    var priceTaxInput = $row.find('.priceTax')[0];
+    var cessInput = $row.find('.cess')[0];
+    var qtyInput = $row.find('.qty')[0];
+    
+    // 获取值并处理空值情况
+    var price = parseFloat(priceInput.value) || 0;
+    var priceTax = parseFloat(priceTaxInput.value) || 0;
+    var cess = parseFloat(cessInput.value) || 0; // 税率,如果没有值则设为0
+    var qty = parseFloat(qtyInput.value) || 0;
+    
+    // 获取当前活动的输入框,以确定触发源
+    var activeElement = document.activeElement;
+    
+    // 判断是哪个字段触发了计算
+    var isPriceChange = activeElement === priceInput;
+    var isPriceTaxChange = activeElement === priceTaxInput;
+    var isCessChange = activeElement === cessInput;
+    
+    // 计算逻辑
+    if (isPriceChange && priceInput.value !== '') {
+        // 已知税前单价和税率,计算税后单价: 税前单价 * (1 + 税率 * 0.01)
+        var calculatedPriceTax = price * (1 + cess / 100);
+        priceTaxInput.value = calculatedPriceTax.toFixed(2);
+    } else if (isPriceTaxChange && priceTaxInput.value !== '') {
+        // 已知税后单价和税率,计算税前单价: 税后单价 / (1 + 税率 * 0.01)
+        var calculatedPrice = priceTax / (1 + cess / 100);
+        priceInput.value = calculatedPrice.toFixed(2);
+    } else if (isCessChange) {
+        // 税率变化时,根据当前有效的单价重新计算另一个单价
+        // 优先使用税前单价计算税后单价(如果税前单价有值)
+        if (price > 0) {
+            var calculatedPriceTaxFromPrice = price * (1 + cess / 100);
+            priceTaxInput.value = calculatedPriceTaxFromPrice.toFixed(2);
+        } else if (priceTax > 0) {
+            // 如果税前单价无值但税后单价有值,则根据税后单价反算税前单价
+            var calculatedPriceFromPriceTax = priceTax / (1 + cess / 100);
+            priceInput.value = calculatedPriceFromPriceTax.toFixed(2);
+        }
+        // 如果两个单价都无值,则税率变化无需计算
+    }
+    
+    // 无论哪个字段变化,最终都更新总价
+    calculateTotalPrice();
+}
+
+// 计算所有物品的总价
+function calculateTotalPrice() {
+    var total = 0;
+    var rows = document.querySelectorAll('.startTr1:not(.hide)');
+    
+    rows.forEach(function(row) {
+        var priceTaxInput = row.querySelector('.priceTax');
+        var qtyInput = row.querySelector('.qty');
+        
+        var priceTax = parseFloat(priceTaxInput.value) || 0;
+        var qty = parseFloat(qtyInput.value) || 0;
+        
+        total += priceTax * qty;
+    });
+    
+    // 更新总价
+    //document.getElementById('contract_money').value = total.toFixed(2); 
+    document.getElementById('totalPrice').value = total.toFixed(2);
 }

+ 40 - 5
src/main/webapp/yw/contract/contractFlowCustom/processContract.jsp

@@ -161,8 +161,9 @@
  			if (se == 1) {
  				$(".startTr1").not(".hide").each(function (i, v) {
  	                rs = $.validate({ name: "contractMaterialList[" + i + "].qty", model: [{type: "require", msg: "数量不能为空!"}] }) && rs;
- 	                rs = $.validate({ name: "contractMaterialList[" + i + "].price", model: [{type: "require", msg: "价不能为空!"}] }) && rs;
+ 	               rs = $.validate({ name: "contractMaterialList[" + i + "].price", model: [{type: "require", msg: "税前单价不能为空!"}] }) && rs;
  	                rs = $.validate({ name: "contractMaterialList[" + i + "].cess", model: [{type: "require", msg: "税率不能为空!"}] }) && rs; 
+ 	                rs = $.validate({ name: "contractMaterialList[" + i + "].priceTax", model: [{type: "require", msg: "税后单价不能为空!"}] }) && rs;
  	            });
  	 			
  	 			$(".startTr2").not(".hide").each(function (i, v) {
@@ -170,6 +171,20 @@
  	                rs = $.validate({ name: "contractPaymentList[" + i + "].amount", model: [{type: "require", msg: "金额不能为空!"}] }) && rs;
  	                rs = $.validate({ name: "contractPaymentList[" + i + "].amountPaid", model: [{type: "require", msg: "已付金额不能为空!"}] }) && rs; 
  	            });
+ 	 			
+ 	 			if(rs == true){
+ 	 				var detailSize = $('.startTr1:not(.hide)').length;
+ 	 				if(detailSize > 0){
+ 	 					var contract_money=$("#contract_money").val();
+ 	 					var totalPrice=$("#totalPrice").val();
+ 	 					if(!contract_money){
+ 	 						$("#contract_money").val(totalPrice);
+ 	 					}else if(contract_money != totalPrice){
+ 	 						addError("合同金额和物料总金额不一致");  
+ 	 						rs = false;
+ 	 					}
+ 	 				}
+ 	 			}
  			}
  			return rs; 
         }
@@ -199,6 +214,18 @@
                 } 
             }); 
         } 
+        
+        // 使用事件委托监听所有输入框的变化
+        $(document).on('input', '.startTr1:not(.hide) input.price, .startTr1:not(.hide) input.priceTax, .startTr1:not(.hide) input.cess, .startTr1:not(.hide) input.qty', function () {
+            // 当任何行的单价、税率、数量发生变化时,重新计算该行的另一单价和总价
+            var row = $(this).closest('tr')[0];
+            calculatePrice(row);
+        });
+        
+        // 页面加载完成后初始化总价
+        $(document).ready(function() {
+            calculateTotalPrice();
+        });
     </script>
     <style type="text/css">
         .l-table-edit-new {
@@ -710,8 +737,9 @@
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</th>
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单位</th>  
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">数量</th> 
-                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单价</th>
+                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税前单价</th>
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</th> 
+                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税后单价</th>
             </tr>
 			<c:forEach items="${contractMaterialList}" var="items">
                 <tr class="startTr1">
@@ -735,7 +763,10 @@
                         <input type="text" name="" class="input-width price TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.price}">
                     </td>
                     <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
-                        <input type="text" name="" class="input-width cess TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.cess}">
+                        <input type="text" name="" class="input-width cess TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.cess}"> 
+                    </td>
+                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
+                        <input type="text" name="" class="input-width priceTax TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.priceTax}">
                         <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
                     </td> 
                 </tr>
@@ -743,6 +774,7 @@
             <tr id="firstPoint"></tr> 
             <input id="purchaseId" name="contractInfo.purchaseId" type="hidden" value="${contractInfo.purchaseId }"/> 
 			<input id="purchaseNumber" name="contractInfo.purchaseNumber" type="hidden" value="${contractInfo.purchaseNumber }"/> 
+			<input id="totalPrice" name="contractInfo.totalPrice" type="hidden" value=""/> 
         </table>
     </div> 
     
@@ -834,8 +866,11 @@
             <input type="text" name="" class="input-width price" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
         </td>
         <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
-            <input type="text" name="" class="input-width cess" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
-             <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
+            <input type="text" name="" class="input-width cess" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')"> 
+        </td>
+        <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
+            <input type="text" name="" class="input-width priceTax" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
+            <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
         </td>
     </tr>
     

+ 38 - 5
src/main/webapp/yw/contract/contractFlowCustom/startContract.jsp

@@ -48,6 +48,7 @@
                     if (yes == true) {
                         obj.remove();
                         addMaterialIdAndName(); 
+                        calculateTotalPrice(); 
                      	// 检查物料行是否为空
                         if ($(".startTr1").not(".hide").length === 0) {
                             $("#purchaseId").val('');
@@ -111,8 +112,9 @@
  			
  			$(".startTr1").not(".hide").each(function (i, v) {
                 rs = $.validate({ name: "contractMaterialList[" + i + "].qty", model: [{type: "require", msg: "数量不能为空!"}] }) && rs;
-                rs = $.validate({ name: "contractMaterialList[" + i + "].price", model: [{type: "require", msg: "价不能为空!"}] }) && rs;
+                rs = $.validate({ name: "contractMaterialList[" + i + "].price", model: [{type: "require", msg: "税前单价不能为空!"}] }) && rs;
                 rs = $.validate({ name: "contractMaterialList[" + i + "].cess", model: [{type: "require", msg: "税率不能为空!"}] }) && rs; 
+                rs = $.validate({ name: "contractMaterialList[" + i + "].priceTax", model: [{type: "require", msg: "税后单价不能为空!"}] }) && rs;
             });
  			
  			$(".startTr2").not(".hide").each(function (i, v) {
@@ -120,6 +122,20 @@
                 rs = $.validate({ name: "contractPaymentList[" + i + "].amount", model: [{type: "require", msg: "金额不能为空!"}] }) && rs;
                 rs = $.validate({ name: "contractPaymentList[" + i + "].amountPaid", model: [{type: "require", msg: "已付金额不能为空!"}] }) && rs; 
             });
+ 			if(rs == true){
+ 				var detailSize = $('.startTr1:not(.hide)').length;
+ 				if(detailSize > 0){
+ 					var contract_money=$("#contract_money").val();
+ 					var totalPrice=$("#totalPrice").val();
+ 					if(!contract_money){
+ 						$("#contract_money").val(totalPrice);
+ 					}else if(contract_money != totalPrice){
+ 						addError("合同金额和物料总金额不一致");  
+ 						rs = false;
+ 					}
+ 				}
+ 			}
+ 			
  			return rs; 
         }
         
@@ -146,7 +162,19 @@
                     callback(false); 
                 } 
             }); 
-        } 
+        }
+        
+        // 使用事件委托监听所有输入框的变化
+        $(document).on('input', '.startTr1:not(.hide) input.price, .startTr1:not(.hide) input.priceTax, .startTr1:not(.hide) input.cess, .startTr1:not(.hide) input.qty', function () {
+            // 当任何行的单价、税率、数量发生变化时,重新计算该行的另一单价和总价
+            var row = $(this).closest('tr')[0];
+            calculatePrice(row);
+        });
+        
+        // 页面加载完成后初始化总价
+        $(document).ready(function() {
+            calculateTotalPrice();
+        });
     </script>
     <style type="text/css">
         .l-table-edit-new {
@@ -351,13 +379,15 @@
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</th>
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单位</th>  
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">数量</th> 
-                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单价</th>
+                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税前单价</th>
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</th> 
+                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税后单价</th>
             </tr>
 
             <tr id="firstPoint"></tr> 
 			<input id="purchaseId" name="contractInfo.purchaseId" type="hidden" value="${contractInfo.purchaseId }"/> 
 			<input id="purchaseNumber" name="contractInfo.purchaseNumber" type="hidden" value="${contractInfo.purchaseNumber }"/> 
+			<input id="totalPrice" name="contractInfo.totalPrice" type="hidden" value=""/> 
         </table>
     </div> 
     
@@ -423,8 +453,11 @@
             <input type="text" name="" class="input-width price" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
         </td>
         <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
-            <input type="text" name="" class="input-width cess" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
-             <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
+            <input type="text" name="" class="input-width cess" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')"> 
+        </td>
+        <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
+            <input type="text" name="" class="input-width priceTax" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
+            <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
         </td>
     </tr>
     

+ 7 - 3
src/main/webapp/yw/contract/contractFlowCustom/viewContract.jsp

@@ -306,8 +306,9 @@
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</th>
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单位</th>  
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">数量</th> 
-                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单价</th>
+                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税前单价</th>
                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</th> 
+                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税后单价</th>
             </tr>
 			<c:forEach items="${contractMaterialList}" var="items">
                 <tr class="startTr1">
@@ -331,9 +332,12 @@
                         <input type="text" name="" class="input-width price TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.price}">
                     </td>
                     <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
-                        <input type="text" name="" class="input-width cess TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.cess}">
-                        <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
+                        <input type="text" name="" class="input-width cess TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.cess}"> 
                     </td> 
+                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
+                        <input type="text" name="" class="input-width priceTax TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.priceTax}">
+                        <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
+                    </td>
                 </tr>
             </c:forEach>
             <tr id="firstPoint"></tr> 

+ 19 - 8
src/main/webapp/yw/contract/contractPurchaseOrder/createPurchaseOrder.jsp

@@ -69,7 +69,7 @@ table.l-table-edit-new td {
         });
 
 
-        //计算物品合计金额
+        /* //计算物品合计金额
         $(".qty").live('blur', function () {
             calTotalAmount();
         });
@@ -78,7 +78,7 @@ table.l-table-edit-new td {
         });
         $(".cess").live('blur', function () {
             calTotalAmount();
-        });
+        }); */
 
         toggleSourceFieldsInit();
 
@@ -104,8 +104,9 @@ table.l-table-edit-new td {
         rs = $.validate({name: "contractPurchaseOrder.supplierName", model: [{type: "require", msg: "供应商不能为空!"}]}) && rs;
         $(".startTr1").not(".hide").each(function (i, v) {
             rs = $.validate({ name: "contractPurchaseOrderDetailList[" + i + "].qty", model: [{type: "require", msg: "数量不能为空!"}] }) && rs;
-            rs = $.validate({ name: "contractPurchaseOrderDetailList[" + i + "].price", model: [{type: "require", msg: "价不能为空!"}] }) && rs;
+            rs = $.validate({ name: "contractPurchaseOrderDetailList[" + i + "].price", model: [{type: "require", msg: "税前单价不能为空!"}] }) && rs;
             rs = $.validate({ name: "contractPurchaseOrderDetailList[" + i + "].cess", model: [{type: "require", msg: "税率不能为空!"}] }) && rs;
+            rs = $.validate({ name: "contractPurchaseOrderDetailList[" + i + "].priceTax", model: [{type: "require", msg: "税后单价不能为空!"}] }) && rs;
         });
         return rs;
 	}
@@ -118,6 +119,13 @@ table.l-table-edit-new td {
 		}  */
 	}
 
+	 // 使用事件委托监听所有输入框的变化
+    $(document).on('input', '.startTr1:not(.hide) input.price, .startTr1:not(.hide) input.priceTax, .startTr1:not(.hide) input.cess, .startTr1:not(.hide) input.qty', function () {
+        // 当任何行的单价、税率、数量发生变化时,重新计算该行的另一单价和总价
+        var row = $(this).closest('tr')[0];
+        calculatePrice(row);
+    }); 
+     
 </script>
 </head>
 <body>
@@ -206,19 +214,19 @@ table.l-table-edit-new td {
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">型号/规格</th>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">单位</th>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">数量</th>
-				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">单价</th>
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">税前单价</th>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">税率</th>
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">税后单价</th>
 				            </tr>
 
 				            <tr id="firstPoint"></tr>
 				            <tr>
-				                <td class="l-table-edit-new" colspan="4" style="padding-right: 0px;padding-left: 0px;"></td>
+				                <td class="l-table-edit-new" colspan="6" style="padding-right: 0px;padding-left: 0px;"></td>
 				                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;"> 合计(元):</td>
 				                <td class="l-table-edit-new" colspan="1"
 				                    style="padding-right: 0px;padding-left: 0px;text-align: center;">
 				                    <input type="text" name="contractPurchaseOrder.totalAmount" id="totalAmount" class="input-width" readonly>
-				                </td>
-				                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;"></td>
+				                </td> 
 				            </tr>
 
 				        </table>
@@ -261,7 +269,10 @@ table.l-table-edit-new td {
             <input type="text" name="" class="input-width price" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
         </td>
         <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
-            <input type="text" name="" class="input-width cess" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
+            <input type="text" name="" class="input-width cess" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')"> 
+        </td>
+        <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
+            <input type="text" name="" class="input-width priceTax" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
              <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
         </td>
     </tr>

+ 17 - 6
src/main/webapp/yw/contract/contractPurchaseOrder/editPurchaseOrder.jsp

@@ -121,6 +121,11 @@ table.l-table-edit-new td {
 		}
 	}
  
+	$(document).on('input', '.startTr1:not(.hide) input.price, .startTr1:not(.hide) input.priceTax, .startTr1:not(.hide) input.cess, .startTr1:not(.hide) input.qty', function () {
+        // 当任何行的单价、税率、数量发生变化时,重新计算该行的另一单价和总价
+        var row = $(this).closest('tr')[0];
+        calculatePrice(row);
+    }); 
 </script>
 </head>
 <body>
@@ -214,8 +219,9 @@ table.l-table-edit-new td {
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">型号/规格</th> 
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">单位</th>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">数量</th>
-				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">单价</th>
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">税前单价</th>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">税率</th> 
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">税后单价</th>
 				            </tr>
 							<c:forEach items="${contractPurchaseOrderDetailList}" var="items"> 
 				                <tr class="startTr1">
@@ -240,19 +246,21 @@ table.l-table-edit-new td {
 				                    </td>
 				                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
 				                        <input type="text" name="" class="input-width cess TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.cess}">
-				                        <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
 				                    </td> 
+				                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
+				                        <input type="text" name="" class="input-width priceTax TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.priceTax}">
+				                        <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
+				                    </td>
 				                </tr>
 				            </c:forEach>
 				            <tr id="firstPoint"></tr>
 				            <tr>
-				                <td class="l-table-edit-new" colspan="4" style="padding-right: 0px;padding-left: 0px;"></td>
+				                <td class="l-table-edit-new" colspan="6" style="padding-right: 0px;padding-left: 0px;"></td>
 				                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;"> 合计(元):</td>
 				                <td class="l-table-edit-new" colspan="1"
 				                    style="padding-right: 0px;padding-left: 0px;text-align: center;">
 				                    <input type="text" name="contractPurchaseOrder.totalAmount" id="totalAmount" class="input-width" readonly value="${contractPurchaseOrder.totalAmount}">
-				                </td>
-				                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;"></td>
+				                </td> 
 				            </tr>
 
 				        </table>
@@ -296,7 +304,10 @@ table.l-table-edit-new td {
         </td>
         <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
             <input type="text" name="" class="input-width cess" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
-             <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
+        </td>
+         <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
+            <input type="text" name="" class="input-width priceTax" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
+            <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
         </td>
     </tr>
 </table>

+ 8 - 4
src/main/webapp/yw/contract/contractPurchaseOrder/infoPurchaseOrder.jsp

@@ -217,8 +217,9 @@ table.l-table-edit-new td {
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">型号/规格</th>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">单位</th>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">数量</th> 
-				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">单价</th>
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">税前单价</th>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">税率</th> 
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">税后单价</th>
 				            </tr>
 							<c:forEach items="${contractPurchaseOrderDetailList}" var="items">
 				                <tr class="startTr1">
@@ -242,20 +243,23 @@ table.l-table-edit-new td {
 				                        <input type="text" name="" class="input-width price TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.price}">
 				                    </td>
 				                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
-				                        <input type="text" name="" class="input-width cess TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.cess}">
+				                        <input type="text" name="" class="input-width cess TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.cess}"> 
+				                    </td>
+				                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
+				                        <input type="text" name="" class="input-width priceTax TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.priceTax}">
 				                        <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
 				                    </td>
 				                </tr>
 				            </c:forEach>
 				            <tr id="firstPoint"></tr>
 				            <tr>
-				                <td class="l-table-edit-new" colspan="4" style="padding-right: 0px;padding-left: 0px;"></td>
+				                <td class="l-table-edit-new" colspan="6" style="padding-right: 0px;padding-left: 0px;"></td>
 				                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;"> 合计(元):</td>
 				                <td class="l-table-edit-new" colspan="1"
 				                    style="padding-right: 0px;padding-left: 0px;text-align: center;">
 				                     ${contractPurchaseOrder.totalAmount}
 				                </td>
-				                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;"></td>
+				                 
 				            </tr>
 
 				        </table>

+ 57 - 4
src/main/webapp/yw/contract/contractPurchaseOrder/js/purchaseOrder.js

@@ -2,9 +2,9 @@
 function calTotalAmount() {
     var totalAmount = 0; 
     $(".startTr1").not(".hide").each(function (i, v) {
-        var val1 = $(v).find("input.qty").val();
-        var val2 = $(v).find("input.price").val();
-        var val3 = $(v).find("input.cess").val();
+        var val1 = $(v).find("input.qty").val() || 0;
+        var val2 = $(v).find("input.price").val() || 0;
+        var val3 = $(v).find("input.cess").val() || 0;
         if (val1 != undefined && val2 != undefined && val3 != undefined) {
             var totalPrice = Number(val1) * Number(val2) * (1+Number(val3)*0.01);
             totalPrice = Number(totalPrice).toFixed(2); 
@@ -122,10 +122,12 @@ function addMaterial(index, row,readonly) {
 		$(cloneObj).find("input.qty").attr("name", "contractPurchaseOrderDetailList[" + index + "].qty").val(row.qty || 0);
 		$(cloneObj).find("input.price").attr("name", "contractPurchaseOrderDetailList[" + index + "].price").val(row.price || 0);
 		$(cloneObj).find("input.cess").attr("name", "contractPurchaseOrderDetailList[" + index + "].cess").val(row.cess || 0);
+		$(cloneObj).find("input.priceTax").attr("name", "contractPurchaseOrderDetailList[" + index + "].priceTax").val(row.priceTax || 0);
 		if (readonly) {
 	        $(cloneObj).find("input.price").attr("readonly", "readonly");
 	        $(cloneObj).find("input.cess").attr("readonly", "readonly");
 	        $(cloneObj).find("input.qty").attr("readonly", "readonly");
+	        $(cloneObj).find("input.priceTax").attr("readonly", "readonly");
 	    }
 		$("#firstPoint").before(cloneObj);
 		calTotalAmount();
@@ -143,6 +145,7 @@ function addIdAndName() {
         $(v).find("input.price").attr("name", "contractPurchaseOrderDetailList[" + i + "].price"); 
         $(v).find("input.cess").attr("name", "contractPurchaseOrderDetailList[" + i + "].cess"); 
         $(v).find("input.measureName").attr("name", "contractPurchaseOrderDetailList[" + i + "].measureName");
+        $(v).find("input.priceTax").attr("name", "contractPurchaseOrderDetailList[" + i + "].priceTax"); 
     }); 
 }
 
@@ -671,4 +674,54 @@ function toggleSourceFields() {
 
 function closeTabUseInOA() {
 	window.parent.tab.removeSelectedTabItem();
-}
+}
+
+function calculatePrice(row) {
+    // 获取当前行的输入元素
+    var $row = $(row); // 转换为jQuery对象方便操作
+    var priceInput = $row.find('.price')[0];
+    var priceTaxInput = $row.find('.priceTax')[0];
+    var cessInput = $row.find('.cess')[0];
+    var qtyInput = $row.find('.qty')[0];
+    
+    // 获取值并处理空值情况
+    var price = parseFloat(priceInput.value) || 0;
+    var priceTax = parseFloat(priceTaxInput.value) || 0;
+    var cess = parseFloat(cessInput.value) || 0; // 税率,如果没有值则设为0
+    var qty = parseFloat(qtyInput.value) || 0;
+    
+    // 获取当前活动的输入框,以确定触发源
+    var activeElement = document.activeElement;
+    
+    // 判断是哪个字段触发了计算
+    var isPriceChange = activeElement === priceInput;
+    var isPriceTaxChange = activeElement === priceTaxInput;
+    var isCessChange = activeElement === cessInput;
+    
+    // 计算逻辑
+    if (isPriceChange && priceInput.value !== '') {
+        // 已知税前单价和税率,计算税后单价: 税前单价 * (1 + 税率 * 0.01)
+        var calculatedPriceTax = price * (1 + cess / 100);
+        priceTaxInput.value = calculatedPriceTax.toFixed(2);
+    } else if (isPriceTaxChange && priceTaxInput.value !== '') {
+        // 已知税后单价和税率,计算税前单价: 税后单价 / (1 + 税率 * 0.01)
+        var calculatedPrice = priceTax / (1 + cess / 100);
+        priceInput.value = calculatedPrice.toFixed(2);
+    } else if (isCessChange) {
+        // 税率变化时,根据当前有效的单价重新计算另一个单价
+        // 优先使用税前单价计算税后单价(如果税前单价有值)
+        if (price > 0) {
+            var calculatedPriceTaxFromPrice = price * (1 + cess / 100);
+            priceTaxInput.value = calculatedPriceTaxFromPrice.toFixed(2);
+        } else if (priceTax > 0) {
+            // 如果税前单价无值但税后单价有值,则根据税后单价反算税前单价
+            var calculatedPriceFromPriceTax = priceTax / (1 + cess / 100);
+            priceInput.value = calculatedPriceFromPriceTax.toFixed(2);
+        }
+        // 如果两个单价都无值,则税率变化无需计算
+    }
+    
+    // 无论哪个字段变化,最终都更新总价
+    //calculateTotalPrice();
+    calTotalAmount();
+} 

+ 4 - 0
src/main/webapp/yw/contract/purchaseNoContract/selectContractPurchase.jsp

@@ -75,6 +75,9 @@ function initContractPurchaseList(){
 	var contractPurchaseName=$("#contractPurchaseName").val();
 	params=params+"&contractPurchaseName="+encodeURI(encodeURI(contractPurchaseName)); 
 	 
+	var noContract=$("#noContract").val();
+	params=params+"&noContract="+noContract;
+	
 	loadContractPurchaseList(params);
 }
 
@@ -159,6 +162,7 @@ input[type='button']{
 		<div style="overflow: hidden; clear: both;">
 				<div id="contractPurchaseGrid" style="margin: 0; padding: 0"></div>
 		</div>
+		<input type="hidden" name="noContract" id="noContract" value="${noContract}" />
 	</div> 
 </BODY>
 </HTML>

+ 6 - 1
src/main/webapp/yw/contract/selectContractMaterial.jsp

@@ -57,7 +57,7 @@ function loadMaterialList(params) {
 									width : 150
 								},
 								{
-									display : '价',
+									display : '税前单价',
 									name : 'price',
 									width : 150
 								},
@@ -65,6 +65,11 @@ function loadMaterialList(params) {
 									display : '税率',
 									name : 'cess',
 									width : 150
+								},
+								{
+									display : '税后单价',
+									name : 'priceTax',
+									width : 150
 								}],
 						pageSize : 10,
 						checkbox: true, 

+ 10 - 4
src/main/webapp/yw/contract/selectMaterialForContract.jsp

@@ -225,7 +225,7 @@ function selectPurchase() {
 		height : 350,
 		width : 750,
 		title : '选择采购申请',
-		url : 'purchaseNoContractAction.do?task=toSelectPurchase&time=' + new Date().getTime(),
+		url : 'purchaseNoContractAction.do?task=toSelectPurchase&noContract=true&time=' + new Date().getTime(),
 		showMax : false,
 		showToggle : true,
 		showMin : false,
@@ -328,12 +328,18 @@ body {
 				</ul>
 			</div>
 			<div class="pur_search" style="display: none;">
-				<ul class="list_search" style="float:left;width:265px;" >
+				<ul class="list_search" style="float:left;width:185px;" >
 					<li class="title" style="width:80px;">采购申请单:</li>
-					<li class="text" style="width:180px;">
+					<li class="text" style="width:100px;">
 						<input type="hidden" id="contractPurchaseFormId" name="contractPurchaseFormId" value="" />
 		                <input type="text" readonly="readonly" id="contractPurchaseFormNumber" name="contractPurchaseFormNumber" value=""/> 
-		                <img id="searchPurchase" class="fee" onClick="selectPurchase()" src="${pageContext.request.contextPath}/images/sousuo.png" style="height: 20px; width: 20px; cursor: pointer;">
+		                <%-- <img id="searchPurchase" class="fee" onClick="selectPurchase()" src="${pageContext.request.contextPath}/images/sousuo.png" style="height: 20px; width: 20px; cursor: pointer;"> --%>
+		                
+					</li>
+				</ul>
+				<ul style="float:left;;width:85px;margin-left:50px;">
+					<li class="search-button"> 
+						<input type="button" class='l-button' name="searchPurchase" onclick="selectPurchase()" value="选择" />
 					</li>
 				</ul>
 			</div> 

+ 2 - 1
src/main/webapp/yw/contract/viewContractEntryInfo.jsp

@@ -213,9 +213,10 @@ function f_initRequestGrid() {
         { display: '物料名称', name: 'itemName',type:'text',isSort:false,width:250},
         { display: '规格型号', name: 'specification',type:'text',isSort:false},
         { display: '单位', name: 'measureName',type:'text',isSort:false},		 
-        { display: '单价', name: 'price',type:'text',isSort:false},
         { display: '数量', name: 'qty',type:'text', isSort:false },
+        { display: '税前单价', name: 'price',type:'text',isSort:false},
         { display: '税率', name: 'cess',type:'text',isSort:false },
+        { display: '税后单价', name: 'priceTax',type:'text',isSort:false},
         { display: '明细ID', name: 'universalid',type:'text',isSort:false, hide: true}],
         data:{Rows:requestProductData}, 
         //checkbox : true,

+ 11 - 3
src/main/webapp/yw/contract/viewContractStatus.jsp

@@ -242,8 +242,9 @@ body {
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">物料名称</td>
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</td> 
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">数量</td> 
-								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单价</td>
+								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税前单价</td>
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</td> 
+								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税后单价</td>
 								            </tr>
 								            <c:forEach items="${items.purchaseOrderDetails}" var="detail">
 								                <tr>
@@ -265,6 +266,9 @@ body {
 								                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
 								                        ${detail.cess}
 								                    </td> 
+								                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
+								                        ${detail.priceTax}
+								                    </td>
 								                </tr>
 								            </c:forEach>
 									   </table>
@@ -295,8 +299,9 @@ body {
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">物料名称</td>
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</td> 
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">数量</td> 
-								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单价</td>
-								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</td> 
+								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税前单价</td>
+								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</td>
+								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税后单价</td> 
 								            </tr>
 								            <c:forEach items="${items.itemRecptLineList}" var="detail">
 								                <tr>
@@ -317,6 +322,9 @@ body {
 								                    </td>
 								                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
 								                        ${detail.cess}
+								                    </td>
+								                     <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
+								                        ${detail.priceTax}
 								                    </td> 
 								                </tr>
 								            </c:forEach>

+ 14 - 5
src/main/webapp/yw/master1_contract/contractPurchaseOrder/createPurchaseOrder.jsp

@@ -113,6 +113,11 @@ body {
 		saveForm("contractPurchaseOrderAction.do", "#cform", "MTContractPurchaseOrderAction.do?task=toList");
 	}
  
+	$(document).on('input', '.startTr1:not(.hide) input.price, .startTr1:not(.hide) input.priceTax, .startTr1:not(.hide) input.cess, .startTr1:not(.hide) input.qty', function () {
+        // 当任何行的单价、税率、数量发生变化时,重新计算该行的另一单价和总价
+        var row = $(this).closest('tr')[0];
+        calculatePrice(row);
+    });
 </script>
 </head>
 <body ontouchmove="event.preventDefault();">
@@ -212,13 +217,14 @@ body {
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</th> 
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单位</th> 
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">数量</th> 
-				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单价</th>
-				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</th> 
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税前单价</th>
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</th>
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税后单价</th>
 				            </tr>
 				
 				            <tr id="firstPoint"></tr>
 				            <tr>
-				                <td class="l-table-edit-new" colspan="4" style="padding-right: 0px;padding-left: 0px;"></td>
+				                <td class="l-table-edit-new" colspan="5" style="padding-right: 0px;padding-left: 0px;"></td>
 				                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;"> 合计(元):</td>
 				                <td class="l-table-edit-new" colspan="1"
 				                    style="padding-right: 0px;padding-left: 0px;text-align: center;">
@@ -267,8 +273,11 @@ body {
         <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
             <input type="text" name="" class="input-width price" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
         </td>
-        <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
-            <input type="text" name="" class="input-width cess" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
+        <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
+            <input type="text" name="" class="input-width cess" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')"> 
+        </td>
+        <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;">
+            <input type="text" name="" class="input-width priceTax" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
              <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
         </td>
     </tr>

+ 19 - 6
src/main/webapp/yw/master1_contract/contractPurchaseOrder/editPurchaseOrder.jsp

@@ -116,6 +116,11 @@ body {
 		saveForm("contractPurchaseOrderAction.do", "#cform", "MTContractPurchaseOrderAction.do?task=toList");
 	}
  
+	$(document).on('input', '.startTr1:not(.hide) input.price, .startTr1:not(.hide) input.priceTax, .startTr1:not(.hide) input.cess, .startTr1:not(.hide) input.qty', function () {
+        // 当任何行的单价、税率、数量发生变化时,重新计算该行的另一单价和总价
+        var row = $(this).closest('tr')[0];
+        calculatePrice(row);
+    });
 </script>
 </head>
 <body ontouchmove="event.preventDefault();">
@@ -217,10 +222,12 @@ body {
 				            <tr>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">物料编码</th>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">物料名称</th>
-				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</th> 
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</th>
+				                 <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单位</th> 
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">数量</th> 
-				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单价</th>
-				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</th> 
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税前单价</th>
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</th>
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税后单价</th>
 				            </tr>
 							<c:forEach items="${contractPurchaseOrderDetailList}" var="items"> 
 				                <tr class="startTr1">
@@ -245,13 +252,16 @@ body {
 				                    </td>
 				                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
 				                        <input type="text" name="" class="input-width cess TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.cess}">
-				                        <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
 				                    </td> 
+				                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
+				                        <input type="text" name="" class="input-width priceTax TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.priceTax}">
+				                        <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
+				                    </td>
 				                </tr>
 				            </c:forEach>
 				            <tr id="firstPoint"></tr>
 				            <tr>
-				                <td class="l-table-edit-new" colspan="4" style="padding-right: 0px;padding-left: 0px;"></td>
+				                <td class="l-table-edit-new" colspan="5" style="padding-right: 0px;padding-left: 0px;"></td>
 				                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;"> 合计(元):</td>
 				                <td class="l-table-edit-new" colspan="1"
 				                    style="padding-right: 0px;padding-left: 0px;text-align: center;">
@@ -302,7 +312,10 @@ body {
         </td>
         <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
             <input type="text" name="" class="input-width cess" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
-             <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
+        </td>
+        <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
+            <input type="text" name="" class="input-width priceTax" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
+            <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
         </td>
     </tr>
 </table>

+ 8 - 4
src/main/webapp/yw/master1_contract/contractPurchaseOrder/infoPurchaseOrder.jsp

@@ -220,8 +220,9 @@ body {
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</th> 
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单位</th>
 				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">数量</th> 
-				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单价</th>
-				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</th> 
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税前单价</th>
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</th>
+				                <th class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税后单价</th>
 				            </tr>
 							<c:forEach items="${contractPurchaseOrderDetailList}" var="items"> 
 				                <tr class="startTr1">
@@ -246,13 +247,16 @@ body {
 				                    </td>
 				                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
 				                        <input type="text" name="" class="input-width cess TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.cess}">
-				                        <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
 				                    </td> 
+				                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
+				                        <input type="text" name="" class="input-width priceTax TextDisplay" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" value="${items.priceTax}">
+				                        <img align="bottom" style="cursor: pointer" class="substract1" src="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/images/index/jian.png">
+				                    </td>
 				                </tr>
 				            </c:forEach>
 				            <tr id="firstPoint"></tr>
 				            <tr>
-				                <td class="l-table-edit-new" colspan="4" style="padding-right: 0px;padding-left: 0px;"></td>
+				                <td class="l-table-edit-new" colspan="5" style="padding-right: 0px;padding-left: 0px;"></td>
 				                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;"> 合计(元):</td>
 				                <td class="l-table-edit-new" colspan="1"
 				                    style="padding-right: 0px;padding-left: 0px;text-align: center;">

+ 3 - 2
src/main/webapp/yw/master1_contract/viewContractSearch.jsp

@@ -193,10 +193,11 @@ function f_initRequestGrid() {
         { display: '物料编码', name: 'itemCode',type:'text',isSort:false},
         { display: '物料名称', name: 'itemName',type:'text',isSort:false,width:250},
         { display: '规格型号', name: 'specification',type:'text',isSort:false},
-        { display: '单位', name: 'measureName',type:'text',isSort:false},		 
-        { display: '单价', name: 'price',type:'text',isSort:false},
+        { display: '单位', name: 'measureName',type:'text',isSort:false},	 
         { display: '数量', name: 'qty',type:'text',isSort:false }, 
+        { display: '税前单价', name: 'price',type:'text',isSort:false},
         { display: '税率', name: 'cess',type:'text',isSort:false }, 
+        { display: '税后单价', name: 'priceTax',type:'text',isSort:false},
         { display: '明细ID', name: 'universalid',type:'text',isSort:false, hide: true}],
         data:{Rows:requestProductData}, 
         //checkbox : true,

+ 11 - 3
src/main/webapp/yw/master1_contract/viewContractStatus.jsp

@@ -229,8 +229,9 @@ body {
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">物料名称</td>
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</td> 
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">数量</td> 
-								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单价</td>
+								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税前单价</td>
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</td> 
+								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税后单价</td>
 								            </tr>
 								            <c:forEach items="${items.purchaseOrderDetails}" var="detail">
 								                <tr>
@@ -252,6 +253,9 @@ body {
 								                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
 								                        ${detail.cess}
 								                    </td> 
+								                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
+								                        ${detail.priceTax}
+								                    </td>
 								                </tr>
 								            </c:forEach>
 									   </table>
@@ -282,8 +286,9 @@ body {
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">物料名称</td>
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">型号/规格</td> 
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">数量</td> 
-								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">单价</td>
+								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税前单价</td>
 								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税率</td> 
+								                <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">税后单价</td>
 								            </tr>
 								            <c:forEach items="${items.itemRecptLineList}" var="detail">
 								                <tr>
@@ -304,7 +309,10 @@ body {
 								                    </td>
 								                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
 								                        ${detail.cess}
-								                    </td> 
+								                    </td>
+								                    <td class="l-table-edit-new" colspan="1" style="padding-right: 0px;padding-left: 0px;text-align: center;">
+								                        ${detail.priceTax}
+								                    </td>
 								                </tr>
 								            </c:forEach>
 									   </table>