DS7_JinGang
hanxuntao 2 years ago
parent 37fc5dc7ef
commit 22c53d569e

@ -389,66 +389,66 @@ namespace DSWeb.MvcShipping.Controllers
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) }; return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
} }
var FEESAVENOTSAMEAMOUNT = MsSysParamSetDAL.GetData("PARAMNAME='FEESAVENOTSAMEAMOUNT'"); // var FEESAVENOTSAMEAMOUNT = MsSysParamSetDAL.GetData("PARAMNAME='FEESAVENOTSAMEAMOUNT'");
if (FEESAVENOTSAMEAMOUNT.PARAMVALUE == "1"&& feetype==2) // if (FEESAVENOTSAMEAMOUNT.PARAMVALUE == "1"&& feetype==2)
{ // {
var oldfeelist = MsChFeeDAL.GetAllDataList("BSNO='" + bsno + "' AND FEETYPE=2"); // var oldfeelist = MsChFeeDAL.GetAllDataList("BSNO='" + bsno + "' AND FEETYPE=2");
var findlist = new List<MsChFee>(); // var findlist = new List<MsChFee>();
foreach (var fee in oldfeelist) // foreach (var fee in oldfeelist)
{ // {
var newfee = bodyList.Find(X => X.GId == fee.GId); // var newfee = bodyList.Find(X => X.GId == fee.GId);
if (newfee == null&&fee.FeeType == 2) // if (newfee == null&&fee.FeeType == 2)
{ // {
var newinvlink = findlist.Find(X => X.Currency == fee.Currency && X.CustomerName == fee.CustomerName && X.Amount == fee.Amount); // var newinvlink = findlist.Find(X => X.Currency == fee.Currency && X.CustomerName == fee.CustomerName && X.Amount == fee.Amount);
if (newinvlink == null) // if (newinvlink == null)
{ // {
var InvLink = new MsChFee(); // var InvLink = new MsChFee();
InvLink.Currency = fee.Currency; // InvLink.Currency = fee.Currency;
InvLink.CustomerName = fee.CustomerName; // InvLink.CustomerName = fee.CustomerName;
InvLink.Amount = fee.Amount; // InvLink.Amount = fee.Amount;
findlist.Add(InvLink); // findlist.Add(InvLink);
} // }
else // else
{ // {
var jsonRespose3 = new JsonResponse // var jsonRespose3 = new JsonResponse
{ // {
Success = false, // Success = false,
Message = "客户名称,金额,币别 ,相同,不允许保存,请调整!", // Message = "客户名称,金额,币别 ,相同,不允许保存,请调整!",
}; // };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose3) }; // return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose3) };
} // }
} // }
} // }
foreach (var fee in bodyList) // foreach (var fee in bodyList)
{ // {
if (fee.FeeType == 2) // if (fee.FeeType == 2)
{ // {
var newinvlink = findlist.Find(X => X.Currency == fee.Currency && X.CustomerName == fee.CustomerName && X.Amount == fee.Amount); // var newinvlink = findlist.Find(X => X.Currency == fee.Currency && X.CustomerName == fee.CustomerName && X.Amount == fee.Amount);
if (newinvlink == null) // if (newinvlink == null)
{ // {
var InvLink = new MsChFee(); // var InvLink = new MsChFee();
InvLink.Currency = fee.Currency; // InvLink.Currency = fee.Currency;
InvLink.CustomerName = fee.CustomerName; // InvLink.CustomerName = fee.CustomerName;
InvLink.Amount = fee.Amount; // InvLink.Amount = fee.Amount;
findlist.Add(InvLink); // findlist.Add(InvLink);
} // }
else // else
{ // {
var jsonRespose3 = new JsonResponse // var jsonRespose3 = new JsonResponse
{ // {
Success = false, // Success = false,
Message = "客户名称,金额,币别 ,相同,不允许保存,请调整!", // Message = "客户名称,金额,币别 ,相同,不允许保存,请调整!",
}; // };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose3) }; // return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose3) };
} // }
} // }
} // }
} //}
if (isyj == "1") if (isyj == "1")

@ -48,7 +48,8 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
this.AMENDSELFWORKFLOW = 0; this.AMENDSELFWORKFLOW = 0;
this.FEENOTPR=false; this.FEENOTPR=false;
this.ISWACC=0; this.ISWACC=0;
this.FEEMANGERMUSTBE=0; this.FEEMANGERMUSTBE = 0;
this.FEESAVENOTSAMEAMOUNT = 0;
this.MODIFYCUSTBFFEELOCK=0; this.MODIFYCUSTBFFEELOCK=0;
this.DrRangDaStr=" 1=1 "; this.DrRangDaStr=" 1=1 ";
this.CrRangDaStr=" 1=1 "; this.CrRangDaStr=" 1=1 ";
@ -5673,6 +5674,33 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
}, },
scope: this scope: this
}); });
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='FEESAVENOTSAMEAMOUNT'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
this.FEESAVENOTSAMEAMOUNT = 1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({ Ext.Ajax.request({
waitMsg: '', waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable', url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
@ -7274,7 +7302,7 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
var bodyDrChFeeDatas = []; var bodyDrChFeeDatas = [];
var i; var i;
this.isrepeatfee = 0;
if (type == '1') { if (type == '1') {
for (i = 0; i < this.storeDrChFee.getCount(); i += 1) { for (i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var memberyf = this.storeDrChFee.getAt(i); var memberyf = this.storeDrChFee.getAt(i);
@ -7291,7 +7319,10 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
}; };
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas); var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
} else if (type == '2') { } else if (type == '2') {
this.TMPstoreDrChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false
});
for (i = 0; i < this.storeCrChFee.getCount(); i += 1) { for (i = 0; i < this.storeCrChFee.getCount(); i += 1) {
var memberyf = this.storeCrChFee.getAt(i); var memberyf = this.storeCrChFee.getAt(i);
if (memberyf.data.Currency ==LOCALCURR&&memberyf.data.ExChangerate!=1) { if (memberyf.data.Currency ==LOCALCURR&&memberyf.data.ExChangerate!=1) {
@ -7304,11 +7335,27 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
bodyDrChFeeDatas.push(memberyf); bodyDrChFeeDatas.push(memberyf);
var amount = memberyf.data.Amount; var amount = memberyf.data.Amount;
var ExChangerate = memberyf.data.ExChangerate; var ExChangerate = memberyf.data.ExChangerate;
if (this.FEESAVENOTSAMEAMOUNT == 1) {
for (var j = 0; j < this.TMPstoreDrChFee.getCount(); j += 1) {
var memberbody = this.TMPstoreDrChFee.getAt(j);
if (memberbody.data.CustomerName == memberyf.data.CustomerName && memberbody.data.FeeName == memberyf.data.FeeName
&& memberbody.data.Amount == memberyf.data.Amount && memberbody.data.Currency == memberyf.data.Currency)
{
this.isrepeatfee = 1
}
}
if (this.isrepeatfee == 0) {
this.TMPstoreDrChFee.add(memberyf);
}
}
}; };
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas); var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
}else if (type == '3') { }else if (type == '3') {
this.TMPstoreDrChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false
});
for (i = 0; i < this.storeDrChFee.getCount(); i += 1) { for (i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var memberyf = this.storeDrChFee.getAt(i); var memberyf = this.storeDrChFee.getAt(i);
if (memberyf.data.Currency ==LOCALCURR&&memberyf.data.ExChangerate!=1) { if (memberyf.data.Currency ==LOCALCURR&&memberyf.data.ExChangerate!=1) {
@ -7333,6 +7380,18 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
bodyDrChFeeDatas.push(memberyf); bodyDrChFeeDatas.push(memberyf);
var amount = memberyf.data.Amount; var amount = memberyf.data.Amount;
var ExChangerate = memberyf.data.ExChangerate; var ExChangerate = memberyf.data.ExChangerate;
if (this.FEESAVENOTSAMEAMOUNT == 1) {
for (var j = 0; j < this.TMPstoreDrChFee.getCount(); j += 1) {
var memberbody = this.TMPstoreDrChFee.getAt(j);
if (memberbody.data.CustomerName == memberyf.data.CustomerName && memberbody.data.FeeName == memberyf.data.FeeName
&& memberbody.data.Amount == memberyf.data.Amount && memberbody.data.Currency == memberyf.data.Currency) {
this.isrepeatfee = 1
}
}
if (this.isrepeatfee == 0) {
this.TMPstoreDrChFee.add(memberyf);
}
}
}; };
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas); var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
@ -7343,69 +7402,96 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: '请先保存业务信息!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: '请先保存业务信息!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return; return;
} }
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu); if (this.FEESAVENOTSAMEAMOUNT == 1 && this.isrepeatfee == 1) {
Ext.Ajax.request({ Ext.MessageBox.confirm('提示', '结算对象,金额,币别,费用名称,相同,确定保存?', function (btn) {
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在保存数据...', if (btn == 'yes') {
url: '/MvcShipping/MsChFee/Save', Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
scope: this, Ext.Ajax.request({
params: { waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
bsno: _thisfee.strBSNO, url: '/MvcShipping/MsChFee/Save',
type: type, scope: this,
chfeebody: jsonChFeeBody params: {
}, bsno: _thisfee.strBSNO,
callback: function (options, success, response) { type: type,
if (success) { chfeebody: jsonChFeeBody
Ext.MessageBox.hide(); },
var jsonresult = Ext.JSON.decode(response.responseText); callback: function (options, success, response) {
if (jsonresult.Success) { if (success) {
// if (type == '1') { Ext.MessageBox.hide();
// for (var i = 0; i < this.storeDrChFee.getCount(); i += 1) { var jsonresult = Ext.JSON.decode(response.responseText);
// var member = this.storeDrChFee.getAt(i); if (jsonresult.Success) {
// member.set("BsNo", _thisfee.strBSNO);
// member.commit();
// }
//// this.gridDrChFee.unSelectAll();
// } else if (type == '2') {
// for (var i = 0; i < this.storeCrChFee.getCount(); i += 1) {
// var member = this.storeCrChFee.getAt(i);
// member.set("BsNo", _thisfee.strBSNO);
// member.commit();
// }
//// this.gridCrChFee.unSelectAll();
// }
if (type == 1) { if (type == 1) {
_thisfee.LoadDrChFee(); _thisfee.LoadDrChFee();
} else if (type == 2) { } else if (type == 2) {
_thisfee.LoadCrChFee(); _thisfee.LoadCrChFee();
} else { } else {
_thisfee.LoadDrChFee(); _thisfee.LoadDrChFee();
_thisfee.LoadCrChFee(); _thisfee.LoadCrChFee();
}
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
} else {
return false;
}
})
} else {
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
url: '/MvcShipping/MsChFee/Save',
scope: this,
params: {
bsno: _thisfee.strBSNO,
type: type,
chfeebody: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (type == 1) {
_thisfee.LoadDrChFee();
} else if (type == 2) {
_thisfee.LoadCrChFee();
} else {
_thisfee.LoadDrChFee();
_thisfee.LoadCrChFee();
}
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
} }
//this.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb } });
//this.storeChFeeMasterGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb } });
//this.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb },
// callback: function (r, options, success) {
// if (success) {
// _thisfee.setTotalHead();
// }
// }
//});
} else { } else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} }
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} }
} });
}); }
}, //end save }, //end save
onShenModifyClick: function (button, event, type) { onShenModifyClick: function (button, event, type) {
var allow = this.getAllowOperationDetail(); var allow = this.getAllowOperationDetail();

Loading…
Cancel
Save