增加-零售出库单据-增加会员卡号和部分字段的默认值

This commit is contained in:
季圣华 2017-06-21 00:06:52 +08:00
parent b1eaa0cc8b
commit 8aa1f98682
5 changed files with 146 additions and 13 deletions

View File

@ -346,6 +346,46 @@ public class SupplierAction extends BaseAction<SupplierModel>
}
}
/**
* 查找散户信息-下拉框
* @return
*/
public void findBySelect_retail()
{
try
{
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
pageUtil.setPageSize(0);
pageUtil.setCurPage(0);
pageUtil.setAdvSearch(getCondition_Select_retail());
supplierService.find(pageUtil);
List<Supplier> 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);
}
}
/**
* 拼接搜索条件
* @return
@ -380,6 +420,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
condition.put("id_s_order", "desc");
return condition;
}
/**
* 拼接搜索条件-下拉框-客户
* @return
@ -395,6 +436,21 @@ public class SupplierAction extends BaseAction<SupplierModel>
return condition;
}
/**
* 拼接搜索条件-下拉框-散户
* @return
*/
private Map<String,Object> getCondition_Select_retail()
{
/**
* 拼接搜索条件
*/
Map<String,Object> condition = new HashMap<String,Object>();
condition.put("type_s_like", "散户");
condition.put("id_s_order", "desc");
return condition;
}
//=============以下spring注入以及Model驱动公共方法与Action处理无关==================
@Override
public SupplierModel getModel()

View File

@ -83,3 +83,63 @@ function getUrlParam(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;
}

View File

@ -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','<img src="' + path + '/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加' + 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");
getAmount.off("keyup").on("keyup",function() {
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() {
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);
}
});

View File

@ -39,6 +39,7 @@
<option value="">全部</option>
<option value="供应商">供应商</option>
<option value="客户">客户</option>
<option value="散户">散户</option>
</select>
</td>
<td>&nbsp;</td>
@ -86,6 +87,7 @@
<select name="type" id="type" style="width:230px;">
<option value="供应商">供应商</option>
<option value="客户">客户</option>
<option value="散户">散户</option>
</select>
</div>
<div class="fitem" style="padding:5px">

View File

@ -68,7 +68,7 @@
<form id="depotHeadFM" method="post" novalidate>
<table>
<tr>
<td>购买单位</td>
<td>会员卡号</td>
<td style="padding:5px">
<input id="OrganId" name="OrganId" style="width:110px;" />
</td>
@ -111,7 +111,7 @@
</tr>
<tr>
<td colspan="2">
<input id="getAmount" name="getAmount" class="get-amount" data-changeamount="0" />
<input id="getAmount" name="getAmount" onKeypress="return (/[\d.]/.test(String.fromCharCode(event.keyCode)))" class="get-amount" data-changeamount="0" />
</td>
</tr>
<tr>
@ -149,7 +149,7 @@
closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table>
<tr>
<td>购买单位</td>
<td>会员卡号</td>
<td style="padding:5px;width:110px;">
<span id="OrganIdShow"></span>
</td>