Commit 6a081353 authored by 季圣华's avatar 季圣华
Browse files

优化 礼品充值和礼品销售

parent d9a00b81
...@@ -723,9 +723,6 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel> ...@@ -723,9 +723,6 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
private Map<String,Object> getConditionHead_Gift_In() { private Map<String,Object> getConditionHead_Gift_In() {
Map<String,Object> condition = new HashMap<String,Object>(); Map<String,Object> condition = new HashMap<String,Object>();
if(model.getProjectId()!=null) {
condition.put("AllocationProjectId_n_eq", model.getProjectId());
}
return condition; return condition;
} }
......
...@@ -97,16 +97,16 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO ...@@ -97,16 +97,16 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便 //多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
Query query; Query query;
StringBuffer queryString = new StringBuffer(); StringBuffer queryString = new StringBuffer();
queryString.append("select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and SubType='" + subType +"'"); queryString.append("select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and jsh_depothead.SubType='" + subType +"'");
if(ProjectId!=null) { if(ProjectId!=null) {
if(type.equals("in")){ if(type.equals("in")){
queryString.append(" and AllocationProjectId='" + ProjectId +"'"); //礼品充值时 queryString.append(" and jsh_depotitem.AnotherDepotId='" + ProjectId +"'"); //礼品充值时
} }
else if(type.equals("out")){ else if(type.equals("out")){
queryString.append(" and DepotId='" + ProjectId +"'"); queryString.append(" and jsh_depotitem.DepotId='" + ProjectId +"'");
} }
} }
queryString.append(" and MaterialId ="+ MId); queryString.append(" and jsh_depotitem.MaterialId ="+ MId);
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch())); query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size()); pageUtil.setTotalCount(query.list().size());
pageUtil.setPageList(query.list()); pageUtil.setPageList(query.list());
......
...@@ -474,7 +474,7 @@ ...@@ -474,7 +474,7 @@
}); });
} }
var isShowLastMoneyColumn = false; //是否显示优惠后金额和价税合计,true为隐藏,false为显示 var isShowLastMoneyColumn = false; //是否显示优惠后金额和价税合计,true为隐藏,false为显示
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货"){ if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "礼品充值" || listSubType == "礼品销售"){
isShowLastMoneyColumn = true; //隐藏 isShowLastMoneyColumn = true; //隐藏
} }
$('#tableData').datagrid({ $('#tableData').datagrid({
...@@ -581,7 +581,7 @@ ...@@ -581,7 +581,7 @@
loadRatio = thisRatio; loadRatio = thisRatio;
} }
} }
else if(listSubType === "销售" || listSubType === "销售退货"){ else if(listSubType === "销售" || listSubType === "销售退货" || listTitle == "礼品充值" || listTitle == "礼品销售"){
unitSetInput = rec.rows[0].FirstOutUnit; unitSetInput = rec.rows[0].FirstOutUnit;
if(basicUnit==unitSetInput){ if(basicUnit==unitSetInput){
loadRatio = 1; loadRatio = 1;
...@@ -668,11 +668,36 @@ ...@@ -668,11 +668,36 @@
var ratio = 1; //比例 var ratio = 1; //比例
var monthTime = getNowFormatMonth(); var monthTime = getNowFormatMonth();
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示 var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
var depotHeadName = ""; //仓库名称
var depotUrl = ""; //仓库接口地址
var depotTextField = ""; //仓库下拉名称
var anotherDepotHeadName = ""; //对方仓库的列的标题
var anotherDepotUrl = ""; //对方仓库接口地址
var anotherDepotTextField = "";
if(listSubType == "调拨"){ if(listSubType == "调拨"){
isShowAnotherDepot = false; //调拨时候显示对方仓库 isShowAnotherDepot = false; //调拨时候显示对方仓库
anotherDepotHeadName = "调入仓库";
anotherDepotUrl = path + '/depot/findDepotByUserId.action?UBType=UserDepot&UBKeyId='+kid;
anotherDepotTextField = "depotName";
}
if(listSubType == "礼品充值"){
isShowAnotherDepot = false; //礼品充值时候显示礼品卡
anotherDepotHeadName = "礼品卡";
anotherDepotUrl = path + "/depot/findGiftByType.action?type=1";
anotherDepotTextField = "name";
}
if(listSubType == "礼品销售"){
depotHeadName = "礼品卡";
depotUrl = path + "/depot/findGiftByType.action?type=1";
depotTextField = "name";
}
else {
depotHeadName = "仓库名称";
depotUrl = path + '/depot/findDepotByUserId.action?UBType=UserDepot&UBKeyId='+kid;
depotTextField = "depotName";
} }
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示 var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货"){ if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "礼品充值" || listSubType == "礼品销售"){
isShowTaxColumn = true; //隐藏 isShowTaxColumn = true; //隐藏
} }
$('#materialData').datagrid({ $('#materialData').datagrid({
...@@ -694,7 +719,7 @@ ...@@ -694,7 +719,7 @@
onClickRow: onClickRow, onClickRow: onClickRow,
columns:[[ columns:[[
{ field: 'Id',width:35,align:"center",checkbox:true}, { field: 'Id',width:35,align:"center",checkbox:true},
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90, { title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
formatter: function (value, row, index) { formatter: function (value, row, index) {
return row.DepotName; return row.DepotName;
}, },
...@@ -702,9 +727,9 @@ ...@@ -702,9 +727,9 @@
type: 'combobox', type: 'combobox',
options: { options: {
valueField: 'id', valueField: 'id',
textField: 'depotName', textField: depotTextField,
method: 'get', method: 'get',
url: path + '/depot/findDepotByUserId.action?UBType=UserDepot&UBKeyId='+kid, url: depotUrl,
onSelect:function(rec){ onSelect:function(rec){
var depotId = rec.id; var depotId = rec.id;
body =$("#depotHeadFM .datagrid-body"); body =$("#depotHeadFM .datagrid-body");
...@@ -797,7 +822,7 @@ ...@@ -797,7 +822,7 @@
loadRatio = ratio; loadRatio = ratio;
} }
} }
else if(listSubType === "销售" || listSubType === "销售退货"){ else if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "礼品充值" || listSubType === "礼品销售"){
unitSetInput = res.rows[0].FirstOutUnit; unitSetInput = res.rows[0].FirstOutUnit;
if(basicUnit==unitSetInput){ if(basicUnit==unitSetInput){
loadRatio = 1; loadRatio = 1;
...@@ -837,7 +862,7 @@ ...@@ -837,7 +862,7 @@
if(listTitle == "采购入库列表" || listTitle == "销售退货列表" || listTitle == "其它入库列表") { if(listTitle == "采购入库列表" || listTitle == "销售退货列表" || listTitle == "其它入库列表") {
UnitPrice = basicPresetPriceOne; UnitPrice = basicPresetPriceOne;
} }
else if(listTitle == "销售出库列表" || listTitle == "采购退货列表" || listTitle == "其它出库列表" || listTitle == "调拨出库列表") { else if(listTitle == "销售出库列表" || listTitle == "采购退货列表" || listTitle == "其它出库列表" || listTitle == "调拨出库列表" || listTitle == "礼品充值列表" || listTitle == "礼品销售列表") {
UnitPrice = basicPresetPriceTwo; UnitPrice = basicPresetPriceTwo;
} }
body.find("[field='Stock']").find(input).val(stock); //修改库存 body.find("[field='Stock']").find(input).val(stock); //修改库存
...@@ -846,7 +871,7 @@ ...@@ -846,7 +871,7 @@
if(listTitle == "采购入库列表" || listTitle == "销售退货列表" || listTitle == "其它入库列表") { if(listTitle == "采购入库列表" || listTitle == "销售退货列表" || listTitle == "其它入库列表") {
UnitPrice = otherPresetPriceOne; UnitPrice = otherPresetPriceOne;
} }
else if(listTitle == "销售出库列表" || listTitle == "采购退货列表" || listTitle == "其它出库列表" || listTitle == "调拨出库列表") { else if(listTitle == "销售出库列表" || listTitle == "采购退货列表" || listTitle == "其它出库列表" || listTitle == "调拨出库列表" || listTitle == "礼品充值列表" || listTitle == "礼品销售列表") {
UnitPrice = otherPresetPriceTwo; UnitPrice = otherPresetPriceTwo;
} }
body.find("[field='Stock']").find(input).val((stock/ratio).toFixed(2)); //修改库存 body.find("[field='Stock']").find(input).val((stock/ratio).toFixed(2)); //修改库存
...@@ -883,7 +908,7 @@ ...@@ -883,7 +908,7 @@
} }
} }
} }
else if(listTitle == "销售出库列表" || listTitle == "采购退货列表" || listTitle == "其它出库列表" || listTitle == "调拨出库列表") { else if(listTitle == "销售出库列表" || listTitle == "采购退货列表" || listTitle == "其它出库列表" || listTitle == "调拨出库列表" || listTitle == "礼品充值列表" || listTitle == "礼品销售列表") {
if(res.rows[0].Unit) { //如果存在计量单位信息 if(res.rows[0].Unit) { //如果存在计量单位信息
detailPrice = presetPriceTwo; detailPrice = presetPriceTwo;
} }
...@@ -923,7 +948,7 @@ ...@@ -923,7 +948,7 @@
} }
}, },
{ title: '库存',field: 'Stock',editor:'validatebox',width:70}, { title: '库存',field: 'Stock',editor:'validatebox',width:70},
{ title: '调入仓库',field: 'AnotherDepotId',editor:'validatebox',hidden:isShowAnotherDepot,width:90, { title: anotherDepotHeadName, field: 'AnotherDepotId',editor:'validatebox',hidden:isShowAnotherDepot,width:90,
formatter: function (value, row, index) { formatter: function (value, row, index) {
return row.AnotherDepotName; return row.AnotherDepotName;
}, },
...@@ -931,9 +956,9 @@ ...@@ -931,9 +956,9 @@
type: 'combobox', type: 'combobox',
options: { options: {
valueField: 'id', valueField: 'id',
textField: 'depotName', textField: anotherDepotTextField,
method: 'get', method: 'get',
url: path + '/depot/findDepotByUserId.action?UBType=UserDepot&UBKeyId='+kid url: anotherDepotUrl
} }
} }
}, },
...@@ -1018,11 +1043,24 @@ ...@@ -1018,11 +1043,24 @@
//初始化表格数据-商品列表-查看状态 //初始化表格数据-商品列表-查看状态
function initTableData_material_show(TotalPrice){ function initTableData_material_show(TotalPrice){
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示 var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
var anotherDepotHeadName = ""; //对方仓库的列的标题
var depotHeadName = ""; //仓库的列的标题
if(listSubType == "调拨"){ if(listSubType == "调拨"){
isShowAnotherDepot = false; //调拨时候显示对方仓库 isShowAnotherDepot = false; //调拨时候显示对方仓库
anotherDepotHeadName = "调入仓库";
}
if(listSubType == "礼品充值"){
isShowAnotherDepot = false; //礼品充值时候显示礼品卡
anotherDepotHeadName = "礼品卡";
}
if(listSubType == "礼品销售"){
depotHeadName = "礼品卡";
}
else {
depotHeadName = "仓库名称";
} }
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示 var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货"){ if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "礼品充值" || listSubType == "礼品销售"){
isShowTaxColumn = true; //隐藏 isShowTaxColumn = true; //隐藏
} }
$('#materialDataShow').datagrid({ $('#materialDataShow').datagrid({
...@@ -1040,9 +1078,9 @@ ...@@ -1040,9 +1078,9 @@
showFooter: true, showFooter: true,
onClickRow: onClickRow, onClickRow: onClickRow,
columns:[[ columns:[[
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90}, { title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
{ title: '品名(型号)(制造商)(包装)',field: 'MaterialName',width:230}, { title: '品名(型号)(制造商)(包装)',field: 'MaterialName',width:230},
{ title: '调入仓库',field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90}, { title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
{ title: '单位',field: 'Unit',editor:'validatebox',width:70}, { title: '单位',field: 'Unit',editor:'validatebox',width:70},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:70}, { title: '数量',field: 'OperNumber',editor:'validatebox',width:70},
{ title: '单价',field: 'UnitPrice',editor:'validatebox',width:70}, { title: '单价',field: 'UnitPrice',editor:'validatebox',width:70},
...@@ -1747,245 +1785,222 @@ ...@@ -1747,245 +1785,222 @@
return flag; return flag;
} }
//保存信息 //保存信息
$("#saveDepotHead").unbind().bind({ $("#saveDepotHead").off("click").on("click",function(){
click:function() if(!$('#depotHeadFM').form('validate')){
{ return;
if(!$('#depotHeadFM').form('validate')){ }
return; else {
} //如果初始编号被修改了,就要判断单据编号是否存在
else { if($.trim($("#Number").val()) != $('#Number').attr("data-defaultNumber")){
//如果初始编号被修改了,就要判断单据编号是否存在 //调用查询单据编号是否重名的方法
if($.trim($("#Number").val()) != $('#Number').attr("data-defaultNumber")){ if(checkDepotHeadNumber()){
//调用查询单据编号是否重名的方法 return;
if(checkDepotHeadNumber()){
return;
}
}
//输入框提示
if(listTitle === "采购入库列表"){
if(!$('#OrganId').combobox('getValue')){
$.messager.alert('提示','请选择供应商!','warning');
return;
}
if(!$('#AccountId').val()){
$.messager.alert('提示','请选择结算账户!','warning');
return;
}
}
else if(listTitle === "零售退货列表"){
if(!$('#AccountId').val()){
$.messager.alert('提示','请选择付款账户!','warning');
return;
}
}
else if(listTitle === "销售退货列表"){
if(!$('#OrganId').combobox('getValue')){
$.messager.alert('提示','请选择退货单位!','warning');
return;
}
if(!$('#AccountId').val()){
$.messager.alert('提示','请选择付款账户!','warning');
return;
}
} }
else if(listTitle === "其它入库列表"){ }
if(!$('#OrganId').combobox('getValue')){ //输入框提示
$.messager.alert('提示','请选择往来单位!','warning'); if(listTitle === "采购入库列表"){
return; if(!$('#OrganId').combobox('getValue')){
} $.messager.alert('提示','请选择供应商!','warning');
return;
} }
else if(listTitle === "零售出库列表"){ if(!$('#AccountId').val()){
if(!$('#AccountId').val()){ $.messager.alert('提示','请选择结算账户!','warning');
$.messager.alert('提示','请选择收款账户!','warning'); return;
return;
}
if($("#backAmount").val()-0 <0){
$.messager.alert('提示','找零金额不能小于0!','warning');
return;
}
} }
else if(listTitle === "销售出库列表"){ }
if(!$('#OrganId').combobox('getValue')){ else if(listTitle === "零售退货列表"){
$.messager.alert('提示','请选择购买单位!','warning'); if(!$('#AccountId').val()){
return; $.messager.alert('提示','请选择付款账户!','warning');
} return;
if(!$('#AccountId').val()){
$.messager.alert('提示','请选择收款账户!','warning');
return;
}
} }
else if(listTitle === "采购退货列表"){ }
if(!$('#OrganId').combobox('getValue')){ else if(listTitle === "销售退货列表"){
$.messager.alert('提示','请选择收货单位!','warning'); if(!$('#OrganId').combobox('getValue')){
return; $.messager.alert('提示','请选择退货单位!','warning');
} return;
if(!$('#AccountId').val()){
$.messager.alert('提示','请选择收款账户!','warning');
return;
}
} }
else if(listTitle === "其它出库列表"){ if(!$('#AccountId').val()){
if(!$('#OrganId').combobox('getValue')){ $.messager.alert('提示','请选择付款账户!','warning');
$.messager.alert('提示','请选择往来单位!','warning'); return;
return;
}
} }
else if(listTitle === "调拨出库列表"){ }
else if(listTitle === "其它入库列表"){
if(!$('#OrganId').combobox('getValue')){
$.messager.alert('提示','请选择往来单位!','warning');
return;
} }
var OrganId = null, ProjectId = null,AllocationProjectId = null; }
var ChangeAmount = $.trim($("#ChangeAmount").val()); else if(listTitle === "零售出库列表"){
var TotalPrice = $("#depotHeadFM .datagrid-footer [field='AllPrice'] div").text(); if(!$('#AccountId').val()){
if(listSubType === "礼品销售") { $.messager.alert('提示','请选择收款账户!','warning');
ProjectId = $('#GiftId').combobox('getValue'); //礼品卡 return;
} }
else { if($("#backAmount").val()-0 <0){
ProjectId = $.trim($("#ProjectId").val()); $.messager.alert('提示','找零金额不能小于0!','warning');
return;
} }
if(listSubType ==="调拨"){ }
else if(listTitle === "销售出库列表"){
if(!$('#OrganId').combobox('getValue')){
$.messager.alert('提示','请选择购买单位!','warning');
return;
} }
else if(listSubType ==="礼品充值"){ if(!$('#AccountId').val()){
AllocationProjectId = $('#GiftId').combobox('getValue'); //礼品卡 $.messager.alert('提示','请选择收款账户!','warning');
return;
} }
if(listSubType === "礼品销售") { }
OrganId = orgDefaultId; else if(listTitle === "采购退货列表"){
if(!$('#OrganId').combobox('getValue')){
$.messager.alert('提示','请选择收货单位!','warning');
return;
} }
else if(listSubType ==="礼品充值"){ if(!$('#AccountId').val()){
OrganId = null; $.messager.alert('提示','请选择收款账户!','warning');
return;
} }
else { }
if($('#OrganId').length){ else if(listTitle === "其它出库列表"){
OrganId = $('#OrganId').combobox('getValue'); if(!$('#OrganId').combobox('getValue')){
} $.messager.alert('提示','请选择往来单位!','warning');
return;
} }
if(listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){ }
//付款为负数 else if(listTitle === "调拨出库列表"){
ChangeAmount = 0 - ChangeAmount;
TotalPrice = 0 - TotalPrice; }
var OrganId = null, ProjectId = null,AllocationProjectId = null;
var ChangeAmount = $.trim($("#ChangeAmount").val());
var TotalPrice = $("#depotHeadFM .datagrid-footer [field='AllPrice'] div").text();
if($('#OrganId').length){
OrganId = $('#OrganId').combobox('getValue');
}
if(listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
//付款为负数
ChangeAmount = 0 - ChangeAmount;
TotalPrice = 0 - TotalPrice;
}
//零售时候,可以从会员预付款中扣款
var thisPayType = "现付";
if(listSubType === "零售") {
if($("#payType").val() ==="预付款") {
thisPayType = "预付款";
} }
//零售时候,可以从会员预付款中扣款 }
var thisPayType = "现付"; var SalesmanStr = "";
if(listSubType === "零售") { if(listSubType === "销售" || listSubType === "销售退货"){
if($("#payType").val() ==="预付款") { var Salesman = $('#Salesman').combobox('getValues').toString(); //销售人员
thisPayType = "预付款"; var SalesmanArray = Salesman.split(",");
for (var i = 0; i < SalesmanArray.length; i++) {
if (i === SalesmanArray.length - 1) {
SalesmanStr += "<" + SalesmanArray[i] + ">";
} }
} else {
var SalesmanStr = ""; SalesmanStr += "<" + SalesmanArray[i] + ">,";
if(listSubType === "销售" || listSubType === "销售退货"){
var Salesman = $('#Salesman').combobox('getValues').toString(); //销售人员
var SalesmanArray = Salesman.split(",");
for (var i = 0; i < SalesmanArray.length; i++) {
if (i === SalesmanArray.length - 1) {
SalesmanStr += "<" + SalesmanArray[i] + ">";
}
else {
SalesmanStr += "<" + SalesmanArray[i] + ">,";
}
} }
} }
var getAccountID = $.trim($("#AccountId").val()); }
if($("#AccountId").val() === "many"){ //多账户 var getAccountID = $.trim($("#AccountId").val());
getAccountID = null; if($("#AccountId").val() === "many"){ //多账户
} getAccountID = null;
$.ajax({ }
type:"post", $.ajax({
url: url, type:"post",
dataType: "json", url: url,
async : false, dataType: "json",
data: ({ async : false,
Type: listType, data: ({
SubType: listSubType, Type: listType,
ProjectId: ProjectId, SubType: listSubType,
AllocationProjectId: AllocationProjectId, ProjectId: ProjectId,
DefaultNumber: $.trim($("#Number").attr("data-defaultNumber")),//初始编号 AllocationProjectId: AllocationProjectId,
Number: $.trim($("#Number").val()), DefaultNumber: $.trim($("#Number").attr("data-defaultNumber")),//初始编号
OperTime: $("#OperTime").val(), Number: $.trim($("#Number").val()),
OrganId: OrganId, OperTime: $("#OperTime").val(),
HandsPersonId: $.trim($("#HandsPersonId").val()), OrganId: OrganId,
Salesman: SalesmanStr, //销售人员 HandsPersonId: $.trim($("#HandsPersonId").val()),
AccountId: getAccountID, Salesman: SalesmanStr, //销售人员
ChangeAmount: ChangeAmount, //付款/收款 AccountId: getAccountID,
TotalPrice: TotalPrice, //合计 ChangeAmount: ChangeAmount, //付款/收款
PayType: thisPayType, //现付/预付款 TotalPrice: TotalPrice, //合计
Remark: $.trim($("#Remark").val()), PayType: thisPayType, //现付/预付款
AccountIdList: $("#AccountId").attr("data-accountarr"), //账户列表-多账户 Remark: $.trim($("#Remark").val()),
AccountMoneyList: $("#AccountId").attr("data-accountmoneyarr"), //账户金额列表-多账户 AccountIdList: $("#AccountId").attr("data-accountarr"), //账户列表-多账户
Discount: $.trim($("#Discount").val()), AccountMoneyList: $("#AccountId").attr("data-accountmoneyarr"), //账户金额列表-多账户
DiscountMoney: $.trim($("#DiscountMoney").val()), Discount: $.trim($("#Discount").val()),
DiscountLastMoney: $.trim($("#DiscountLastMoney").val()), DiscountMoney: $.trim($("#DiscountMoney").val()),
OtherMoney: $.trim($("#OtherMoney").val()), //采购费用、销售费用 DiscountLastMoney: $.trim($("#DiscountLastMoney").val()),
OtherMoneyList: $("#OtherMoney").attr("data-itemarr"), //支出项目列表-涉及费用 OtherMoney: $.trim($("#OtherMoney").val()), //采购费用、销售费用
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用 OtherMoneyList: $("#OtherMoney").attr("data-itemarr"), //支出项目列表-涉及费用
AccountDay: $("#AccountDay").val(), //结算天数 OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
clientIp: clientIp AccountDay: $("#AccountDay").val(), //结算天数
}), clientIp: clientIp
success: function (tipInfo) }),
success: function (tipInfo)
{
if(tipInfo)
{ {
if(tipInfo) function closeDialog(){
{ $('#depotHeadDlg').dialog('close');
function closeDialog(){ var opts = $("#tableData").datagrid('options');
$('#depotHeadDlg').dialog('close'); showDepotHeadDetails(opts.pageNumber,opts.pageSize);
var opts = $("#tableData").datagrid('options'); }
showDepotHeadDetails(opts.pageNumber,opts.pageSize);
}
if(thisPayType === "预付款") {
//更新用户信息-预付款
var advanceIn = 0; //预付款金额
if(depotHeadID){
advanceIn = TotalPrice - preTotalPrice; //修改时,预付款=合计金额-加载金额
}
else{
advanceIn = TotalPrice; //新增时,预付款=合计金额
}
$.ajax({
type:"post",
url: path + "/supplier/updateAdvanceIn.action",
dataType: "json",
data:{
SupplierID: OrganId, //会员id
AdvanceIn: 0 - advanceIn //保存的同时扣掉用户的预付款
},
success: function(res){
if(res) {
//保存会员预收款成功
}
},
error: function(){
$.messager.alert('提示','保存信息异常,请稍后再试!','error');
return;
}
});
}
//保存明细记录 if(thisPayType === "预付款") {
if(depotHeadID ==0) //更新用户信息-预付款
{ var advanceIn = 0; //预付款金额
getMaxId(); //查找最大的Id if(depotHeadID){
accept(depotHeadMaxId,closeDialog); //新增 advanceIn = TotalPrice - preTotalPrice; //修改时,预付款=合计金额-加载金额
} }
else else{
{ advanceIn = TotalPrice; //新增时,预付款=合计金额
accept(depotHeadID,closeDialog); //修改
} }
$.ajax({
type:"post",
url: path + "/supplier/updateAdvanceIn.action",
dataType: "json",
data:{
SupplierID: OrganId, //会员id
AdvanceIn: 0 - advanceIn //保存的同时扣掉用户的预付款
},
success: function(res){
if(res) {
//保存会员预收款成功
}
},
error: function(){
$.messager.alert('提示','保存信息异常,请稍后再试!','error');
return;
}
});
}
//保存明细记录
if(depotHeadID ==0)
{
getMaxId(); //查找最大的Id
accept(depotHeadMaxId,closeDialog); //新增
} }
else else
{ {
$.messager.show({ accept(depotHeadID,closeDialog); //修改
title: '错误提示',
msg: '保存信息失败,请稍后重试!'
});
} }
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','保存信息异常,请稍后再试!','error');
return;
} }
}); else
} {
$.messager.show({
title: '错误提示',
msg: '保存信息失败,请稍后重试!'
});
}
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','保存信息异常,请稍后再试!','error');
return;
}
});
} }
}); });
...@@ -2424,13 +2439,6 @@ ...@@ -2424,13 +2439,6 @@
} }
function showDepotHeadDetails(pageNo,pageSize){ function showDepotHeadDetails(pageNo,pageSize){
var ProjectId = null;
if(listSubType === "礼品销售") {
ProjectId = $('#searchGiftId').combobox('getValue'); //礼品卡
}
else {
ProjectId = $.trim($("#searchProjectId").val());
}
$.ajax({ $.ajax({
type:"post", type:"post",
url: path + "/depotHead/findBy.action", url: path + "/depotHead/findBy.action",
......
...@@ -33,21 +33,17 @@ ...@@ -33,21 +33,17 @@
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>礼品卡:</td>
<td>
<input id="searchGiftId" name="searchGiftId" style="width:110px;" />
</td>
<td>单据编号:</td> <td>单据编号:</td>
<td> <td>
<input type="text" name="searchNumber" id="searchNumber" style="width:60px;"/> <input type="text" name="searchNumber" id="searchNumber" style="width:100px;"/>
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
...@@ -63,45 +59,36 @@ ...@@ -63,45 +59,36 @@
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td>礼品卡:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="GiftId" name="GiftId" style="width:120px;" /> <input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>单据日期:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:120px;"/> <input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td>单据编号:</td> <td></td>
<td style="padding:5px"> <td></td>
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 120px;"/> <td></td>
</td> <td></td>
<td style="width:50px;"></td> <td style="width:100px;"></td>
<td style="padding:5px;width:120px;"></td> </tr>
</tr> <tr>
<tr> <td colspan="9">
<td>经手人:</td> <!-- 商品列表table -->
<td style="padding:5px"> <table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
<select name="HandsPersonId" id="HandsPersonId" style="width:120px;"></select> </td>
</td> </tr>
<td>单据备注:</td> <tr>
<td style="padding:5px" colspan="3"> <td colspan="9">
<input name="Remark" id="Remark" class="easyui-validatebox" style="width:320px;"/> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea>
</td> </td>
<td></td> </tr>
<td></td>
</tr>
<tr>
<td>商品列表:</td>
<td colspan="7">
<!-- 商品列表table -->
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
...@@ -110,46 +97,37 @@ ...@@ -110,46 +97,37 @@
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px" <div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
<td>发货仓库:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:120px;"> <td style="padding:5px;width:140px;">
<span id="ProjectIdShow"></span> <span id="OperTimeShow"></span>
</td> </td>
<td>单据日期:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:120px;"> <td style="padding:5px;width:140px;">
<span id="OperTimeShow"></span> <span id="NumberShow"></span>
</td> </td>
<td>单据编号:</td> <td></td>
<td style="padding:5px;width:120px;"> <td></td>
<span id="NumberShow"></span> <td></td>
</td> <td></td>
<td style="width:50px;"></td> <td style="width:100px;"></td>
<td style="padding:5px;width:120px;"> </tr>
</td> <tr>
</tr> <td colspan="9" style="width: 1130px;">
<tr> <!-- 商品列表table -->
<td>经手人:</td> <table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
<td style="padding:5px"> </td>
<span id="HandsPersonIdShow"></span> </tr>
</td> <tr>
<td>单据备注:</td> <td style="width:60px;">单据备注:</td>
<td style="padding:5px" colspan="3"> <td colspan="8" style="height:35px;">
<span id="RemarkShow"></span> <span id="RemarkShow" style="width: 1070px; height:35px;"></span>
</td> </td>
<td></td> </tr>
<td></td> </table>
</tr>
<tr>
<td>商品列表:</td>
<td colspan="7">
<!-- 商品列表table -->
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -33,21 +33,17 @@ ...@@ -33,21 +33,17 @@
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>发货仓库:</td>
<td>
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
</td>
<td>单据编号:</td> <td>单据编号:</td>
<td> <td>
<input type="text" name="searchNumber" id="searchNumber" style="width:60px;"/> <input type="text" name="searchNumber" id="searchNumber" style="width:100px;"/>
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
...@@ -63,48 +59,36 @@ ...@@ -63,48 +59,36 @@
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td>发货仓库:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<select name="ProjectId" id="ProjectId" style="width:120px;"></select> <input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width: 140px;"/>
</td> </td>
<td>单据日期:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:120px;"/> <input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td>经手人:</td> <td></td>
<td style="padding:5px"> <td></td>
<select name="HandsPersonId" id="HandsPersonId" style="width:120px;"></select> <td></td>
</td> <td></td>
<td style="width:50px;"></td> <td style="width:100px;"></td>
<td style="padding:5px;width:120px;"></td> </tr>
</tr> <tr>
<tr> <td colspan="9">
<td>礼品卡:</td> <!-- 商品列表table -->
<td style="padding:5px"> <table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
<input id="GiftId" name="GiftId" style="width:120px;" /> </td>
</td> </tr>
<td>单据编号:</td> <tr>
<td style="padding:5px"><input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 120px;"/> <td colspan="9">
</td> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea>
<td>单据备注:</td> </td>
<td style="padding:5px"> </tr>
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 120px;"/>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>商品列表:</td>
<td colspan="7">
<!-- 商品列表table -->
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
...@@ -113,50 +97,37 @@ ...@@ -113,50 +97,37 @@
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px" <div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
<td>发货仓库:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:120px;"> <td style="padding:5px;width:140px;">
<span id="ProjectIdShow"></span> <span id="OperTimeShow"></span>
</td> </td>
<td>单据日期:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:120px;"> <td style="padding:5px;width:140px;">
<span id="OperTimeShow"></span> <span id="NumberShow"></span>
</td> </td>
<td>经手人:</td> <td></td>
<td style="padding:5px"> <td></td>
<span id="HandsPersonIdShow"></span> <td></td>
</td> <td></td>
<td style="width:50px;"></td> <td style="width:100px;"></td>
<td style="padding:5px;width:120px;"> </tr>
</td> <tr>
</tr> <td colspan="9" style="width: 1130px;">
<tr> <!-- 商品列表table -->
<td>礼品卡:</td> <table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
<td style="padding:5px;width:120px;"> </td>
<span id="AllocationProjectIdShow"></span> </tr>
</td> <tr>
<td>单据编号:</td> <td style="width:60px;">单据备注:</td>
<td style="padding:5px"> <td colspan="8" style="height:35px;">
<span id="NumberShow"></span> <span id="RemarkShow" style="width: 1070px; height:35px;"></span>
</td> </td>
<td>单据备注:</td> </tr>
<td style="padding:5px"> </table>
<span id="RemarkShow"></span>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>商品列表:</td>
<td colspan="7">
<!-- 商品列表table -->
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -174,9 +174,6 @@ ...@@ -174,9 +174,6 @@
type:"post", type:"post",
url: "<%=path %>/depotHead/findGiftReport.action", url: "<%=path %>/depotHead/findGiftReport.action",
dataType: "json", dataType: "json",
data: ({
ProjectId: searchGiftId
}),
success: function (res) { success: function (res) {
var HeadIds = res.HeadIds; var HeadIds = res.HeadIds;
if(HeadIds) { if(HeadIds) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment