diff --git a/src/main/java/com/jsh/action/basic/SupplierAction.java b/src/main/java/com/jsh/action/basic/SupplierAction.java index ce9ea8414..9e720cfc4 100644 --- a/src/main/java/com/jsh/action/basic/SupplierAction.java +++ b/src/main/java/com/jsh/action/basic/SupplierAction.java @@ -345,6 +345,46 @@ public class SupplierAction extends BaseAction Log.errorFileSync(">>>>>>>>>回写查询客户信息结果异常", e); } } + + /** + * 查找散户信息-下拉框 + * @return + */ + public void findBySelect_retail() + { + try + { + PageUtil pageUtil = new PageUtil(); + pageUtil.setPageSize(0); + pageUtil.setCurPage(0); + pageUtil.setAdvSearch(getCondition_Select_retail()); + supplierService.find(pageUtil); + List dataList = pageUtil.getPageList(); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if(null != dataList) + { + for(Supplier supplier:dataList) + { + JSONObject item = new JSONObject(); + item.put("id", supplier.getId()); + //客户名称 + item.put("supplier", supplier.getSupplier()); + dataArray.add(item); + } + } + //回写查询结果 + toClient(dataArray.toString()); + } + catch (DataAccessException e) + { + Log.errorFileSync(">>>>>>>>>查找客户信息异常", e); + } + catch (IOException e) + { + Log.errorFileSync(">>>>>>>>>回写查询客户信息结果异常", e); + } + } /** * 拼接搜索条件 @@ -380,6 +420,7 @@ public class SupplierAction extends BaseAction condition.put("id_s_order", "desc"); return condition; } + /** * 拼接搜索条件-下拉框-客户 * @return @@ -394,6 +435,21 @@ public class SupplierAction extends BaseAction condition.put("id_s_order", "desc"); return condition; } + + /** + * 拼接搜索条件-下拉框-散户 + * @return + */ + private Map getCondition_Select_retail() + { + /** + * 拼接搜索条件 + */ + Map condition = new HashMap(); + condition.put("type_s_like", "散户"); + condition.put("id_s_order", "desc"); + return condition; + } //=============以下spring注入以及Model驱动公共方法,与Action处理无关================== @Override diff --git a/src/main/webapp/js/common/common.js b/src/main/webapp/js/common/common.js index f37e42232..606ea2495 100644 --- a/src/main/webapp/js/common/common.js +++ b/src/main/webapp/js/common/common.js @@ -82,4 +82,64 @@ function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.substr(1).match(reg); //匹配目标参数 if (r != null) return unescape(r[2]); return null; //返回参数值 -} +} + +/** + * js获取当前时间, 格式“yyyy-MM-dd HH:MM:SS” + */ +function getNowFormatDateTime() { + var date = new Date(); + var seperator1 = "-"; + var seperator2 = ":"; + var month = date.getMonth() + 1; + var strDate = date.getDate(); + if (month >= 1 && month <= 9) { + month = "0" + month; + } + if (strDate >= 0 && strDate <= 9) { + strDate = "0" + strDate; + } + var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate + + " " + date.getHours() + seperator2 + date.getMinutes() + + seperator2 + date.getSeconds(); + return currentdate; +} + +/** + * js获取当前时间, 格式“yyyy-MM-dd” + */ +function getNowFormatDate() { + var date = new Date(); + var seperator1 = "-"; + var seperator2 = ":"; + var month = date.getMonth() + 1; + var strDate = date.getDate(); + if (month >= 1 && month <= 9) { + month = "0" + month; + } + if (strDate >= 0 && strDate <= 9) { + strDate = "0" + strDate; + } + var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate; + return currentdate; +} + +/** + * js根据时间生成编号, 格式“yyyyMMddHHMMSS” + */ +function getNowFormatDateNum() { + var date = new Date(); + var seperator1 = "-"; + var seperator2 = ":"; + var month = date.getMonth() + 1; + var strDate = date.getDate(); + if (month >= 1 && month <= 9) { + month = "0" + month; + } + if (strDate >= 0 && strDate <= 9) { + strDate = "0" + strDate; + } + var currentdate = date.getFullYear() + month + strDate + date.getHours() + + date.getMinutes() + date.getSeconds(); + return currentdate; +} \ No newline at end of file diff --git a/src/main/webapp/js/pages/materials/in_out.js b/src/main/webapp/js/pages/materials/in_out.js index 2a3e82ad3..7d48534ba 100644 --- a/src/main/webapp/js/pages/materials/in_out.js +++ b/src/main/webapp/js/pages/materials/in_out.js @@ -20,6 +20,7 @@ var listSubType = ""; //采购 销售等 var payTypeTitle = "";//付款 收款 var organUrl = ""; //组织数据接口地址 + var amountNum = ""; //单据编号开头字符 //初始化系统基础信息 getType(); initSystemData_UB(); @@ -41,59 +42,69 @@ listTitle = $("#tablePanel").prev().text(); var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口 var cusUrl = path + "/supplier/findBySelect_cus.action"; //客户接口 + var retailUrl = path + "/supplier/findBySelect_retail.action"; //散户接口 if(listTitle === "采购入库列表"){ listType = "入库"; listSubType = "采购"; payTypeTitle = "付款"; organUrl = supUrl; + amountNum = "CGRK"; } else if(listTitle === "零售退货列表"){ listType = "入库"; listSubType = "零售退货"; payTypeTitle = "付款"; - organUrl = cusUrl; + organUrl = retailUrl; + amountNum = "LSTH"; } else if(listTitle === "销售退货列表"){ listType = "入库"; listSubType = "销售退货"; payTypeTitle = "付款"; organUrl = cusUrl; + amountNum = "XSTH"; } else if(listTitle === "其它入库列表"){ listType = "入库"; listSubType = "其它"; payTypeTitle = "隐藏"; organUrl = supUrl; + amountNum = "QTRK"; } else if(listTitle === "零售出库列表"){ listType = "出库"; listSubType = "零售"; payTypeTitle = "收款"; - organUrl = cusUrl; + organUrl = retailUrl; + amountNum = "LSCK"; } else if(listTitle === "销售出库列表"){ listType = "出库"; listSubType = "销售"; payTypeTitle = "收款"; organUrl = cusUrl; + amountNum = "XSCK"; } else if(listTitle === "采购退货列表"){ listType = "出库"; listSubType = "采购退货"; payTypeTitle = "收款"; organUrl = supUrl; + amountNum = "CGTH"; } else if(listTitle === "其它出库列表"){ listType = "出库"; listSubType = "其它"; payTypeTitle = "隐藏"; organUrl = cusUrl; + amountNum = "QTCK"; } else if(listTitle === "调拨出库列表"){ listType = "出库"; listSubType = "调拨"; payTypeTitle = "隐藏"; organUrl = supUrl; + amountNum = "DBCK"; } } //初始化系统基础信息 @@ -642,10 +653,13 @@ function addDepotHead(){ $("#clientIp").val(clientIp); $('#depotHeadFM').form('clear'); + var thisDate = getNowFormatDate(); //当前日期 + $("#OperTime").val(thisDate); + var thisNumber = getNowFormatDateNum(); //根据时间生成编号 + $("#Number").val(amountNum + thisNumber).focus(); var addTitle = listTitle.replace("列表","信息"); $('#depotHeadDlg').dialog('open').dialog('setTitle',' 增加' + addTitle); $(".window-mask").css({ width: webW ,height: webH}); - $("#Number").val("").focus(); orgDepotHead = ""; depotHeadID = 0; @@ -656,11 +670,12 @@ //零售单据修改收款时,自动计算找零 if(listSubType == "零售"){ var getAmount = $("#depotHeadFM .get-amount"); + var changeAmount = $("#depotHeadFM .change-amount"); + var backAmount = $("#depotHeadFM .back-amount"); + getAmount.val(0); changeAmount.val(0); backAmount.val(0); //时间初始化 getAmount.off("keyup").on("keyup",function() { - var changeAmount = $("#depotHeadFM .change-amount"); - var backAmount = $("#depotHeadFM .back-amount"); if(changeAmount.val()){ - backAmount.val(getAmount.val()-changeAmount.val()); + backAmount.val((getAmount.val()-changeAmount.val()).toFixed(2)); } }); } @@ -915,7 +930,7 @@ TotalPrice = TotalPrice + UnitPrice*OperNumber; footer.find("[field='AllPrice']").find("div").text((TotalPrice).toFixed(2)); if(listSubType == "零售"){ - $("#ChangeAmount, #getAmount").val(TotalPrice); + $("#ChangeAmount, #getAmount").val((TotalPrice).toFixed(2)); $("#backAmount").val(0); } }); @@ -990,7 +1005,7 @@ TotalPrice = TotalPrice + UnitPrice*OperNumber; footer.find("[field='AllPrice']").find("div").text((TotalPrice).toFixed(2)); if(listSubType == "零售"){ - $("#ChangeAmount, #getAmount").val(TotalPrice); + $("#ChangeAmount, #getAmount").val((TotalPrice).toFixed(2)); $("#backAmount").val(0); } }); @@ -1008,7 +1023,7 @@ TotalPrice = TotalPrice + AllPrice; footer.find("[field='AllPrice']").find("div").text((TotalPrice).toFixed(2)); if(listSubType == "零售"){ - $("#ChangeAmount, #getAmount").val(TotalPrice); + $("#ChangeAmount, #getAmount").val((TotalPrice).toFixed(2)); $("#backAmount").val(0); } }); diff --git a/src/main/webapp/pages/manage/vendor.jsp b/src/main/webapp/pages/manage/vendor.jsp index d5c1145fd..19ce4b336 100644 --- a/src/main/webapp/pages/manage/vendor.jsp +++ b/src/main/webapp/pages/manage/vendor.jsp @@ -39,6 +39,7 @@ +   @@ -86,6 +87,7 @@
diff --git a/src/main/webapp/pages/materials/retail_out_list.jsp b/src/main/webapp/pages/materials/retail_out_list.jsp index 0792f29ac..41d4dd927 100644 --- a/src/main/webapp/pages/materials/retail_out_list.jsp +++ b/src/main/webapp/pages/materials/retail_out_list.jsp @@ -68,7 +68,7 @@
- + @@ -111,7 +111,7 @@ @@ -149,7 +149,7 @@ closed="true" modal="true" cache="false" collapsible="false" closable="true">
购买单位:会员卡号:
- +
- +
购买单位:会员卡号: