master^2
chenwenkai 22 hours ago
commit 898e98a638

@ -31466,11 +31466,11 @@ where c.SKU1=@SKU";
string tsql = @"
if @id>0
begin
Update [HT_CustomFee] set [customname]=@customname,[htdate]=@htdate,[htcode]=@htcode,[yjprice]=@yjprice,[rmbprice]=@rmbprice,[usdprice]=@usdprice,[njprice]=@njprice,[hyprice]=@hyprice,[hlrate]=@hlrate,[llrate]=@llrate,[totalrmbprice]=@totalrmbprice,[totalusdprice]=@totalusdprice,[yfprice]=@yfprice,[lxprice]=@lxprice,[inname]=@inname,[indate]=@indate,[state]=@state where id=@id
Update [HT_CustomFee] set [customname]=@customname,[htdate]=@htdate,[htcode]=@htcode,[yjprice]=@yjprice,[rmbprice]=@rmbprice,[usdprice]=@usdprice,[njprice]=@njprice,[hyprice]=@hyprice,[hlrate]=@hlrate,[llrate]=@llrate,[totalrmbprice]=@totalrmbprice,[totalusdprice]=@totalusdprice,[yfprice]=@yfprice,[lxprice]=@lxprice,[inname]=@inname,[indate]=@indate,[state]=@state,jxdate=@jxdate,feetype=@feetype,hyrmbprice=@hyrmbprice,njrmbprice=@njrmbprice,yjrate=@yjrate,yjrmbprice=@yjrmbprice where id=@id
end
else
begin
INSERT INTO [HT_CustomFee]([customname],[htdate],[htcode],[yjprice],[rmbprice],[usdprice],[njprice],[hyprice],[hlrate],[llrate],[totalrmbprice],[totalusdprice],[yfprice],[lxprice],[inname],[indate],[state])values(@customname,@htdate,@htcode,@yjprice,@rmbprice,@usdprice,@njprice,@hyprice,@hlrate,@llrate,@totalrmbprice,@totalusdprice,@yfprice,@lxprice,@inname,@indate,@state)
INSERT INTO [HT_CustomFee]([customname],[htdate],[htcode],[yjprice],[rmbprice],[usdprice],[njprice],[hyprice],[hlrate],[llrate],[totalrmbprice],[totalusdprice],[yfprice],[lxprice],[inname],[indate],[state],jxdate,feetype,yjrate,njrmbprice,hyrmbprice,yjrmbprice)values(@customname,@htdate,@htcode,@yjprice,@rmbprice,@usdprice,@njprice,@hyprice,@hlrate,@llrate,@totalrmbprice,@totalusdprice,@yfprice,@lxprice,@inname,@indate,@state,@jxdate,@feetype,@yjrate,@njrmbprice,@hyrmbprice,@yjrmbprice)
set @id=SCOPE_IDENTITY()
end
select @id";
@ -31493,6 +31493,12 @@ select @id";
db.AddInParameter(cmd, "@lxprice", DbType.Decimal, Model.lxprice);
db.AddInParameter(cmd, "@inname", DbType.String, Model.inname);
db.AddInParameter(cmd, "@indate", DbType.DateTime, Model.indate);
db.AddInParameter(cmd, "@jxdate", DbType.DateTime, Model.jxdate);
db.AddInParameter(cmd, "@feetype", DbType.Int32, Model.feetype);
db.AddInParameter(cmd, "@yjrate", DbType.Decimal, Model.yjrate);
db.AddInParameter(cmd, "@njrmbprice", DbType.Decimal, Model.njrmbprice);
db.AddInParameter(cmd, "@hyrmbprice", DbType.Decimal, Model.hyrmbprice);
db.AddInParameter(cmd, "@yjrmbprice", DbType.Decimal, Model.yjrmbprice);
db.AddInParameter(cmd, "@state", DbType.Int32, Model.state);
int a = Convert.ToInt32(db.ExecuteScalar(cmd));
return a;
@ -31547,7 +31553,7 @@ select @id";
public static List<HT_CustomFee> GetListCustomFee(string where, int PageIndex, int PageSize, string Sort, out int RowCount)
{
QueryService2 ser = new QueryService2();
ser.Tsql = "select id=cast(a.id as int),a.customname,a.htdate,a.htcode,a.yjprice,a.rmbprice,a.usdprice,a.njprice,a.hyprice,a.hlrate,a.llrate,a.totalrmbprice,a.totalusdprice,a.yfprice,a.lxprice,a.inname,a.indate,a.state from HT_CustomFee a";
ser.Tsql = "select id=cast(a.id as int),a.customname,a.htdate,a.htcode,a.yjprice,a.rmbprice,a.usdprice,a.njprice,a.hyprice,a.hlrate,a.llrate,a.totalrmbprice,a.totalusdprice,yfprice=isnull(a.yfprice,0),a.lxprice,a.inname,a.indate,a.state,a.jxdate,a.feetype,zfprice=case when a.feetype=1 then a.rmbprice else a.usdprice end,a.yjrate,a.njrmbprice,a.hyrmbprice,a.yjrmbprice,days=DATEDIFF(day,jxdate,getdate()),a.predate,days2=case when predate is not null then DATEDIFF(day,predate,getdate()) else -1 end from HT_CustomFee a";
ser.Tsql += " " + ser.Filter(where);
ser.PageIndex = PageIndex;
ser.PageSize = PageSize;
@ -31575,8 +31581,13 @@ Update [HT_CustomFeeDetail] set [feeid]=@feeid,[feedate]=@feedate,[feermbprice]=
end
else
begin
INSERT INTO [HT_CustomFeeDetail]([feeid],[feedate],[feermbprice],[feeusdprice],[hlrate],[feetype],[jsbprice],[jslxprice])values(@feeid,@feedate,@feermbprice,@feeusdprice,@hlrate,@feetype,@jsbprice,@jslxprice)
declare @prefeedate datetime,@prejsbprice decimal(18,2),@preyfprice decimal(18,2)
select @prefeedate=predate,@prejsbprice=lxprice,@preyfprice=yfprice from HT_CustomFee where id=@feeid
INSERT INTO [HT_CustomFeeDetail]([feeid],[feedate],[feermbprice],[feeusdprice],[hlrate],[feetype],[jsbprice],[jslxprice],prefeedate,prejsbprice,preyfprice)values(@feeid,@feedate,@feermbprice,@feeusdprice,@hlrate,@feetype,@jsbprice,@jslxprice,@prefeedate,@prejsbprice,@preyfprice)
set @id=SCOPE_IDENTITY()
update HT_CustomFee set yfprice=@hkprice,lxprice=@leftprice,predate=@feedate where id=@feeid
update HT_CustomFee set state=1 where lxprice<=0
end
select @id";
Database db = DatabaseFactory.CreateDatabase();
@ -31588,8 +31599,10 @@ select @id";
db.AddInParameter(cmd, "@feeusdprice", DbType.Decimal, Model.feeusdprice);
db.AddInParameter(cmd, "@hlrate", DbType.Decimal, Model.hlrate);
db.AddInParameter(cmd, "@feetype", DbType.Int32, Model.feetype);
db.AddInParameter(cmd, "@jsbprice", DbType.Decimal, Model.jsbprice);
db.AddInParameter(cmd, "@jsbprice", DbType.String, Model.jsbprice);
db.AddInParameter(cmd, "@jslxprice", DbType.Decimal, Model.jslxprice);
db.AddInParameter(cmd, "@hkprice", DbType.Decimal, Model.hkprice);
db.AddInParameter(cmd, "@leftprice", DbType.Decimal, Model.leftprice);
int a = Convert.ToInt32(db.ExecuteScalar(cmd));
return a;
}
@ -31598,7 +31611,11 @@ select @id";
public static void Delete_CustomFeeDetail(int id)
{
string tsql = @"
delete from HT_CustomFeeDetail where id=@id";
declare @prefeedate datetime,@prejsbprice decimal(18,2),@preyfprice decimal(18,2),@feeid int
select @prefeedate=prefeedate,@prejsbprice=prejsbprice,@preyfprice=preyfprice,@feeid=feeid from HT_CustomFeeDetail where id=@id
delete from HT_CustomFeeDetail where id=@id
update HT_CustomFee set yfprice=@preyfprice,lxprice=@prejsbprice,predate=@prefeedate,state=0 where id=@feeid
";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddInParameter(cmd, "@id", DbType.Int32, id);
@ -31628,7 +31645,7 @@ select @id";
public static List<HT_CustomFeeDetail> GetListCustomFeeDetail(int feeid)
{
//string tsql = "select a.id,a.feeid,a.feedate,a.feermbprice,a.feeusdprice,a.hlrate,a.feetype,a.jsbprice,a.jslxprice from HT_CustomFeeDetail";
string tsql = "select * from HT_CustomFeeDetail where feeid=@feeid order by a.feedate";
string tsql = "select * from HT_CustomFeeDetail where feeid=@feeid order by feedate";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddInParameter(cmd, "@feeid", DbType.Int32, feeid);

@ -29,6 +29,7 @@
<script type="text/javascript">
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var datagrid2 = new nblf.ui.DataGrid("DataGrid2");
var WindowLoadModel = new WindowLoad();
var Model = null;
$(document).ready(function () {
@ -45,9 +46,26 @@
TableAveColWidth("MainTable");
CreateDataGrid();
CreateDataGrid2();
ReadData();
$("#cmdAdd").click(function () {
$("#a_zhprice").html("");
num = 0;
$("#a_njprice").html("");
num2 = 0;
$("#a_hyprice").html("");
num3 = 0;
Model = new Object();
Model.id = 0;
ClearControlValue("MainTable"); //清空内容
$("#txtyjrate").val("3");
$("#txtllrate").val("0.005");
//var CurrentDate = new Date();
//$("#txtInDate").val(CurrentDate.localeFormat("yyyy-MM-dd"));
ShowFancybox("MainTable");
});
$("#cmdAdd2").click(function () {
Model = new Object();
Model.id = 0;
ClearControlValue("MainTable"); //清空内容
@ -55,7 +73,6 @@
//$("#txtInDate").val(CurrentDate.localeFormat("yyyy-MM-dd"));
ShowFancybox("MainTable");
});
$("#cmdGet").click(function () {
ReadData();
});
@ -67,32 +84,268 @@
$("#cmdBack").click(function () {
$.fancybox.close();
});
zhprice();
zhprice2();
$("#DataGrid1 [CommandName]").live("click", function () {
var CommandName = $(this).attr("CommandName");
var index = $(this).parentsUntil("tr").parent().attr("index");
Model = datagrid1.Get_Model(index);
if (CommandName == "cmdEdit") {
if (Model.yfprice>0) {
alert("该合同已经有付款记录,不能编辑");
return;
}
//有审核时用
//if (Model.State == 1 || Model.State == 2) { $("#cmdSave").hide(); }
//else { $("#cmdSave").show(); }
//if (Model.State == 2) { $("#tr1").show(); }
//else { $("#tr1").hide(); }
CreateGetModel("MainTable", Model);
if (Model.feetype == 1) {
$("#a_zhprice").html("美金$" + Model.usdprice);
num = Model.usdprice;
$("#a_njprice").html("美金$" + Model.njprice);
num2 = Model.njprice;
$("#a_hyprice").html("美金$" + Model.hyprice);
num3 = Model.hyprice;
$("#txtnjprice").val(Model.njrmbprice);
$("#txthyprice").val(Model.hyrmbprice);
}
if (Model.feetype == 2) {
$("#a_zhprice").html("人民币$" + Model.rmbprice);
num = Model.rmbprice;
$("#a_njprice").html("人民币$" + Model.njrmbprice);
num2 = Model.njrmbprice;
$("#a_hyprice").html("人民币$" + Model.hyrmbprice);
num3 = Model.hyrmbprice;
$("#txtnjprice").val(Model.njprice);
$("#txthyprice").val(Model.hyprice);
}
ShowFancybox("MainTable");
}
if (CommandName == "cmdDetail") {
// CreateGetModel("MainTable", Model);
ReadData2(Model.id);
ShowFancybox("MainTable2");
}
if (CommandName == "cmdFee") {
if (Model.state == 1) {
alert("该合同已经结清,不能付款");
return;
}
// CreateGetModel("MainTable", Model);listfeetype2 txthlrate2
num4 = 0;
$("#a_feejsprice").html("");
$("#txtfeedate").val("");
$("#txtjsbprice").val(parseFloat(Model.lxprice) + parseFloat(Model.lxprice2));
$("#listfeetype2").val(Model.feetype);
$("#txthlrate2").val(Model.hlrate);
$("#txtfeejsprice").val("");
$("#a_bz").html(Model.feeflag);
feetype = Model.feetype;
ShowFancybox("MainTable3");
}
if (CommandName == "cmdDel") {
Delete(Model.id);
}
});
$("#DataGrid2 [CommandName]").live("click", function () {
var CommandName = $(this).attr("CommandName");
var index = $(this).parentsUntil("tr").parent().attr("index");
var dmd = datagrid2.Get_Model(index);
if (CommandName == "cmdDel") {
DeleteDetail(dmd.id);
}
});
});
var num = 0;
var num2 = 0;
var num3 = 0;
function zhprice() {
// txthlrate listfeetype txtzfprice a_zhprice
$("#txthlrate,#txtzfprice,#txtnjprice,#txthyprice").keyup(function () {
num = 0;
$("#a_zhprice").html("");
num2 = 0;
$("#a_njprice").html("");
num3 = 0;
$("#a_hyprice").html("");
var hl = parseFloat($("#txthlrate").val());
var bz = $("#listfeetype").val();
var zf = parseFloat($("#txtzfprice").val());
var nj = parseFloat($("#txtnjprice").val());
var hy = parseFloat($("#txthyprice").val());
if (hl > 0 && zf > 0 && bz == 1) {
num = parseFloat(zf / hl);
num = num.toFixed(2);
$("#a_zhprice").html("美金$" + num);
}
if (hl > 0 && zf > 0 && bz == 2) {
num = parseFloat(zf*hl);
num = num.toFixed(2);
$("#a_zhprice").html("人民币¥" + num);
}
if (hl > 0 && nj > 0 && bz == 1) {
num2 = parseFloat(nj / hl);
num2 = num2.toFixed(2);
$("#a_njprice").html("美金$" + num2);
}
if (hl > 0 && nj > 0 && bz == 2) {
num2 = parseFloat(nj * hl);
num2 = num2.toFixed(2);
$("#a_njprice").html("人民币¥" + num2);
}
if (hl > 0 && hy > 0 && bz == 1) {
num3 = parseFloat(hy / hl);
num3 = num3.toFixed(2);
$("#a_hyprice").html("美金$" + num3);
}
if (hl > 0 && hy > 0 && bz == 2) {
num3 = parseFloat(hy * hl);
num3 = num3.toFixed(2);
$("#a_hyprice").html("人民币¥" + num3);
}
});
$("#listfeetype").change(function () {
num = 0;
$("#a_zhprice").html("");
var hl = parseFloat($("#txthlrate").val());
var bz = $("#listfeetype").val();
var zf = parseFloat($("#txtzfprice").val());
var nj = parseFloat($("#txtnjprice").val());
var hy = parseFloat($("#txthyprice").val());
if (hl > 0 && zf > 0 && bz == 1) {
num = parseFloat(zf / hl);
num = num.toFixed(2);
$("#a_zhprice").html("美金$" + num);
}
if (hl > 0 && zf > 0 && bz == 2) {
num = parseFloat(zf * hl);
num = num.toFixed(2);
$("#a_zhprice").html("人民币¥" + num);
}
if (hl > 0 && nj > 0 && bz == 1) {
num2 = parseFloat(nj / hl);
num2 = num2.toFixed(2);
$("#a_njprice").html("美金$" + num2);
}
if (hl > 0 && nj > 0 && bz == 2) {
num2 = parseFloat(nj * hl);
num2 = num2.toFixed(2);
$("#a_njprice").html("人民币¥" + num2);
}
if (hl > 0 && hy > 0 && bz == 1) {
num3 = parseFloat(hy / hl);
num3 = num3.toFixed(2);
$("#a_hyprice").html("美金$" + num3);
}
if (hl > 0 && hy > 0 && bz == 2) {
num3 = parseFloat(hy * hl);
num3 = num3.toFixed(2);
$("#a_hyprice").html("人民币¥" + num3);
}
});
}
var num4 = 0;
function zhprice2() {
// txthlrate listfeetype txtzfprice a_zhprice
$("#txthlrate2,#txtfeejsprice").keyup(function () {
num4 = 0;
$("#a_feejsprice").html("");
var hl = parseFloat($("#txthlrate2").val());
var bz = $("#listfeetype2").val();
var zf = parseFloat($("#txtfeejsprice").val());
if (hl > 0 && zf > 0 && bz == 1) {
num4 = parseFloat(zf / hl);
num4 = num4.toFixed(2);
$("#a_feejsprice").html("美金$" + num4);
}
if (hl > 0 && zf > 0 && bz == 2) {
num4 = parseFloat(zf * hl);
num4 = num4.toFixed(2);
$("#a_feejsprice").html("人民币¥" + num4);
}
});
$("#listfeetype2").change(function () {
num4 = 0;
$("#a_feejsprice").html("");
var hl = parseFloat($("#txthlrate2").val());
var bz = $("#listfeetype2").val();
var zf = parseFloat($("#txtfeejsprice").val());
if (hl > 0 && zf > 0 && bz == 1) {
num4 = parseFloat(zf / hl);
num4 = num4.toFixed(2);
$("#a_feejsprice").html("美金$" + num4);
}
if (hl > 0 && zf > 0 && bz == 2) {
num4 = parseFloat(zf * hl);
num4 = num4.toFixed(2);
$("#a_feejsprice").html("人民币¥" + num4);
}
});
}
//#region 初始化DataGrid
function CreateDataGrid() {
col = new nblf.ui.DataGridColumn();
col = new nblf.ui.DataGridColumn();
col.HeaderText = "客户";
col.CellTemplate ="<span>{Bind customname}</span>";
Array.add(datagrid1.Columns, col);
@ -103,33 +356,41 @@
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "htcode";
col.HeaderText = "合同编号 ";
col.CellTemplate ="<span>{Bind htcode}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "佣金";
col.CellTemplate ="<span>{Bind yjprice}</span>";
col.HeaderText = "币种";
col.CellTemplate = "<span>{Bind feetype}</span>";
col.CellFormatter = function (value) {
switch (value) {
case 1: return "<span>人民币</span>";
case 2: return "<span>美金</span>";
default: return "";
}
};
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "rmbprice";
col.CellTemplate ="<span>{Bind rmbprice}</span>";
col.HeaderText = "金额";
col.CellTemplate ="<span>${Bind usdprice}【¥{Bind rmbprice}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "usdprice";
col.CellTemplate ="<span>{Bind usdprice}</span>";
col.HeaderText = "佣金";
col.CellTemplate = "<span>${Bind yjprice}【¥{Bind yjrmbprice}】</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "内际金额";
col.CellTemplate ="<span>{Bind njprice}</span>";
col.CellTemplate ="<span>${Bind njprice}【¥{Bind njrmbprice}】</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "海运费";
col.CellTemplate ="<span>{Bind hyprice}</span>";
col.CellTemplate ="<span>${Bind hyprice}【¥{Bind hyrmbprice}】</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
@ -139,50 +400,82 @@
col = new nblf.ui.DataGridColumn();
col.HeaderText = "利率";
col.CellTemplate ="<span>{Bind llrate}</span>";
col.CellTemplate ="<span>{Bind llrate}/天</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "totalrmbprice";
col.CellTemplate ="<span>{Bind totalrmbprice}</span>";
col.HeaderText = "计息日期";
col.CellTemplate = "<span>{Bind jxdate,yyyy-MM-dd}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "totalusdprice";
col.CellTemplate ="<span>{Bind totalusdprice}</span>";
col.HeaderText = "计息天数";
col.CellTemplate = "<span>{Bind days}</span>";
Array.add(datagrid1.Columns, col);
//col = new nblf.ui.DataGridColumn();
//col.HeaderText = "totalrmbprice";
//col.CellTemplate ="<span>{Bind totalrmbprice}</span>";
//Array.add(datagrid1.Columns, col);
//col = new nblf.ui.DataGridColumn();
//col.HeaderText = "totalusdprice";
//col.CellTemplate ="<span>{Bind totalusdprice}</span>";
//Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "已付多少";
col.CellTemplate ="<span>{Bind yfprice}</span>";
col.HeaderText = "已付";
col.CellTemplate = "<span>{Bind feeflag}{Bind yfprice}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "累计利息多少";
col.CellTemplate ="<span>{Bind lxprice}</span>";
col.HeaderText = "上次支付日期";
col.CellTemplate = "<span>{Bind predate,yyyy-MM-dd}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "当前欠费金额";
col.CellTemplate = "<span>{Bind feeflag}{Bind lxprice}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "inname";
col.CellTemplate ="<span>{Bind inname}</span>";
col.HeaderText = "当前利息";
col.CellTemplate = "<span>{Bind feeflag}{Bind lxprice2}</span>";
Array.add(datagrid1.Columns, col);
//col = new nblf.ui.DataGridColumn();
//col.HeaderText = "剩余未支付";
//col.CellTemplate = "<span>{Bind feeflag}{Bind leftprice}</span>";
//Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "indate";
col.HeaderText = "创建时间";
col.CellTemplate ="<span>{Bind indate,yyyy-MM-dd}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "0 未结清 1已结清 ";
col.CellTemplate ="<span>{Bind state}</span>";
col.HeaderText = "创建人";
col.CellTemplate = "<span>{Bind inname}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "状态";
col.CellTemplate = "<span>{Bind state}</span>";
col.CellFormatter = function (value) {
switch (value) {
case 0: return "<span>未结清</span>";
case 1: return "<span style='color:green;'>已结清</span>";
default: return "";
}
};
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "付款明细";
col.Width = "160px";
col.CellTemplate = "<span CommandName='cmdDetail' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>付款明细</span>&nbsp;&nbsp;<span CommandName='cmdFee' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>付款</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "160px";
col.CellTemplate = "<span CommandName='cmdEdit' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>编辑</span>&nbsp;&nbsp;<span CommandName='cmdDel' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>删除</span>";
col.Width = "120px";
col.CellTemplate = "<span CommandName='cmdEdit' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>编辑</span>&nbsp;<span CommandName='cmdDel' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>删除</span>";
Array.add(datagrid1.Columns, col);
//datagrid1.SetPageSize(20);
@ -196,6 +489,60 @@
}
//#endregion
//#region 初始化DataGrid
function CreateDataGrid2() {
col = new nblf.ui.DataGridColumn();
col.HeaderText = "支付日期";
col.CellTemplate = "<span>{Bind feedate,yyyy-MM-dd}</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "结算币种";
col.CellTemplate = "<span>{Bind feetype}</span>";
col.CellFormatter = function (value) {
switch (value) {
case 1: return "<span>人民币</span>";
case 2: return "<span>美金</span>";
default: return "";
}
};
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "结算金额";
col.CellTemplate = "<span>${Bind feeusdprice}【¥{Bind feermbprice}】</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "结算汇率";
col.CellTemplate = "<span>{Bind hlrate}</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "结算时欠费金额";
col.CellTemplate = "<span>{Bind jsbprice}</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "160px";
col.CellTemplate = "<span CommandName='cmdDel' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>删除</span>";
Array.add(datagrid2.Columns, col);
//datagrid1.SetPageSize(20);
datagrid2.IsFixHeader = false;
datagrid2.ShowIndexColumn = false;
datagrid2.AllowPaging = false;
datagrid2.Width = "100%";
datagrid2.SelectMode = nblf.ui.SelectMode.None;
datagrid2.Init();
datagrid2.add_PageIndexChanged(function () { ReadData2(); });
}
//#endregion
//#region 读取数据
function ReadData() {
var param = new Object();
@ -213,6 +560,22 @@
});
}
//#endregion
//#region 读取数据
function ReadData2(feeid) {
var param = new Object();
param.feeid = feeid;
$.ajax({
url: "SysManageServiceNew.asmx/GetListCustomFeeDetail",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
datagrid2.DataBind(data.d);
}
});
}
//#endregion
//#region 删除
function Delete(id) {
if (window.confirm("确定要删除吗?") == false) return;
@ -230,12 +593,48 @@
});
}
//#endregion
//#region 删除
function DeleteDetail(id) {
if (window.confirm("确定要删除吗?") == false) return;
var param = new Object();
param.id = id;
WindowLoadModel.Show();
$.ajax({
url: "SysManageServiceNew.asmx/Delete_CustomFeeDetail",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
if (data.d == false) { alert("已经使用过,无法删除"); return; }
ReadData2(Model.id); //刷新DataGrid
ReadData();
}
});
}
//#endregion
//#region 保存
function Save() {
var error = CreateSaveModel("MainTable", Model);
if (error != "") { alert(error); return; }
var param = new Object();
param.Model = Model;
if (Model.feetype == 1) {
Model.rmbprice = $("#txtzfprice").val();
Model.usdprice = num;
Model.njrmbprice = $("#txtnjprice").val();
Model.njprice = num2;
Model.hyrmbprice = $("#txthyprice").val();
Model.hyprice = num3;
}
else if (Model.feetype == 2) {
Model.usdprice = $("#txtzfprice").val();
Model.rmbprice = num;
Model.njprice = $("#txtnjprice").val();
Model.njrmbprice = num2;
Model.rmbprice = $("#txthyprice").val();
Model.hyrmbprice = num3;
}
WindowLoadModel.Show();
$.ajax({
url: "SysManageServiceNew.asmx/Save_CustomFee",
@ -248,6 +647,64 @@
}
});
}
var feetype = 1;
function SaveFeeDetail() {
var param = new Object();
if ($("#txtjsbprice").val() == "") {
alert("欠款金额没填"); return;
}
if ($("#txtfeedate").val() == "") {
alert("付款日期没填"); return;
}
if ($("#txthlrate2").val() == "") {
alert("汇率没填"); return;
}
if ($("#txtfeejsprice").val() == "") {
alert("结算金额没填"); return;
}
var dmd = new Object();
dmd.feeid = Model.id;
dmd.jsbprice = $("#a_bz").html()+$("#txtjsbprice").val();
dmd.feetype = $("#listfeetype2").val();
dmd.hlrate = $("#txthlrate2").val();
dmd.feedate = $("#txtfeedate").val();
param.Model = dmd;
if (dmd.feetype == 1) {
dmd.feermbprice = $("#txtfeejsprice").val();
dmd.feeusdprice = num4;
}
else if (Model.feetype == 2) {
dmd.feeusdprice = $("#txtfeejsprice").val();
dmd.feermbprice = num4;
}
if (feetype == 1) {
dmd.hkprice = dmd.feermbprice;
}
else
dmd.hkprice = dmd.feeusdprice;
dmd.leftprice = parseFloat($("#txtjsbprice").val()) - dmd.hkprice;
WindowLoadModel.Show();
$.ajax({
url: "SysManageServiceNew.asmx/Save_CustomFeeDetail",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
ReadData();
alert("保存成功");
$.fancybox.close();
}
});
}
//#endregion
//#region 显示弹出窗体
function ShowFancybox(id) {
@ -287,16 +744,15 @@
<td><input id='txt_customname' type='text' style='width: 99%' where="a.customname like '%@value%'"/></td>
<td class="f1" >合同日期</td>
<td><input id="txt_StartDate" type="text" style="width: 100px; " onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" where="a.htdate>='@value'" />-<input id="txt_StopDate" type="text" style="width: 100px; " onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" where="a.htdate<= '@value 23:59:59'" /></td>
<td class="f1" >inname</td>
<td><input id='txt_inname' type='text' style='width: 99%' where="a.inname like '%@value%'"/></td>
<td class="f1" >0 未结清 1已结清 </td>
<td><select id='list_state' style="width: 99%;" where="state=@value" binding="BindComboBox2" url="XXX.asmx/XXX" modelid="Id" modelname="Name" TopName="全部" ></select></td>
<td class="f1" >状态</td>
<td><select id='list_state' style="width: 99%;" where="state=@value"><option value="">全部</option><option value="0">未结清</option><option value="1">已结清</option></select></td> <td><input id="cmdGet" type="button" value = "查询" /></td>
</tr>
<td><input id="cmdGet" type="button" value = "查询" /></td>
<tr>
<td colspan="9">
<input id="cmdAdd" type="button" value="新增" />
<input id="cmdAdd" type="button" value="新增" /><font color="red">注:未支付过的按计息日期计算利息,有已支付记录的按上次支付日期开始计算利息(因为上次支付时已经把利息结算到总金额去了)</font>
</td>
</tr>
<tr>
@ -307,80 +763,65 @@
</table>
<div style="display: none;">
<div id="MainTable" title="编辑" style="width: 400px; height: auto;">
<div id="MainTable" title="编辑" style="width:700px; height: auto;">
<table class="tableAll" style="width: 100%;">
<colgroup>
<col style="width: 80px;" />
<col style="width: 120px;" />
<col />
<col style="width: 120px;" />
<col />
</colgroup>
<tr>
<td class="f1" >客户</td>
<td><input id='txtcustomname' type='text' style='width: 99%' columnname="customname" columndesc="客户" columnrequired="false" validtype="" /></td>
</tr>
<tr>
<td class="f1" >合同日期</td>
<td><input id='txthtdate' type='text' style='width: 99%' onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" columnname="htdate" columndesc="合同日期" columnrequired="false" validtype="" columnformat="yyyy-MM-dd" /></td>
</tr>
<tr>
<td class="f1" >htcode</td>
<td><input id='txthtcode' type='text' style='width: 99%' columnname="htcode" columndesc="htcode" columnrequired="false" validtype="" /></td>
</tr>
<tr>
<td class="f1" >佣金</td>
<td><input id='txtyjprice' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="yjprice" columndesc="佣金" columnrequired="false" /></td>
</tr>
<tr>
<td class="f1" >rmbprice</td>
<td><input id='txtrmbprice' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="rmbprice" columndesc="rmbprice" columnrequired="false" /></td>
</tr>
<tr>
<td class="f1" >usdprice</td>
<td><input id='txtusdprice' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="usdprice" columndesc="usdprice" columnrequired="false" /></td>
</tr>
<tr>
<td class="f1" >内际金额</td>
<td><input id='txtnjprice' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="njprice" columndesc="内际金额" columnrequired="false" /></td>
<td class="f1" ><font color="red">*</font>客户</td>
<td><input id='txtcustomname' type='text' style='width: 99%' columnname="customname" columndesc="客户" columnrequired="true" validtype="" /></td> <td class="f1" ><font color="red">*</font>合同编号</td>
<td><input id='txthtcode' type='text' style='width: 99%' columnname="htcode" columndesc="合同编号" columnrequired="true" validtype="" /></td>
</tr>
<tr>
<td class="f1" >海运费</td>
<td><input id='txthyprice' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="hyprice" columndesc="海运费" columnrequired="false" /></td>
</tr>
<tr>
<td class="f1" >汇率</td>
<td><input id='txthlrate' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="hlrate" columndesc="汇率" columnrequired="false" /></td>
</tr>
<tr>
<td class="f1" >利率</td>
<td><input id='txtllrate' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="llrate" columndesc="利率" columnrequired="false" /></td>
</tr>
<tr>
<td class="f1" >totalrmbprice</td>
<td><input id='txttotalrmbprice' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="totalrmbprice" columndesc="totalrmbprice" columnrequired="false" /></td>
<td class="f1" ><font color="red">*</font>合同日期</td>
<td><input id='txthtdate' type='text' style='width: 99%' onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" columnname="htdate" columndesc="合同日期" columnrequired="true" validtype="" columnformat="yyyy-MM-dd" /></td>
<td class="f1" ><font color="red">*</font>佣金比例</td>
<td><input id='txtyjrate' type='text' style='width: 90%' precision="2" min="0" max="99999" columnname="yjrate" columndesc="佣金比例" columnrequired="true" value="3"/>%</td>
</tr>
<tr>
<td class="f1" >totalusdprice</td>
<td><input id='txttotalusdprice' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="totalusdprice" columndesc="totalusdprice" columnrequired="false" /></td>
<td class="f1" ><font color="red">*</font>利率</td>
<td><input id='txtllrate' type='text' style='width: 90%' precision="3" min="0" max="99999" columnname="llrate" columndesc="利率" columnrequired="true" value="0.005" />/天</td>
<td class="f1" ><font color="red">*</font>汇率</td>
<td><input id='txthlrate' type='text' style='width: 99%' precision="3" min="0" max="99999" columnname="hlrate" columndesc="美金汇率" columnrequired="true" /></td>
</tr>
<tr>
<td class="f1" >已付多少</td>
<td><input id='txtyfprice' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="yfprice" columndesc="已付多少" columnrequired="false" /></td>
<tr>
<td class="f1">开始记息日期</td>
<td><input id='txtjxdate' type='text' style='width: 99%' onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" columnname="jxdate" columndesc="开始计息日期" columnrequired="false" validtype="" columnformat="yyyy-MM-dd" /></td>
<td colspan="2"><font color="red">不填就按合同日期开始计算</font></td>
</tr>
<tr>
<td class="f1" >累计利息多少</td>
<td><input id='txtlxprice' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="lxprice" columndesc="累计利息多少" columnrequired="false" /></td>
<td class="f1" ><font color="red">*</font>币种</td>
<td><select id='listfeetype' style="width: 99%;" columnname="feetype" columndesc="结算币种" columnrequired="false">
<option value="1">人民币</option>
<option value="2">美金</option>
</select></td><td class="f1" ><font color="red">*</font>金额</td>
<td><input id='txtzfprice' type='text' style='width: 50%' precision="2" min="0" max="99999" columnname="zfprice" columndesc="金额" columnrequired="true" /><a id="a_zhprice" style="color:red"></a></td>
</tr>
<tr>
<td class="f1" >inname</td>
<td><input id='txtinname' type='text' style='width: 99%' columnname="inname" columndesc="inname" columnrequired="false" validtype="" /></td>
</tr>
<tr>
<td class="f1" >indate</td>
<td><input id='txtindate' type='text' style='width: 99%' onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" columnname="indate" columndesc="indate" columnrequired="false" validtype="" columnformat="yyyy-MM-dd" /></td>
<td class="f1" ><font color="red">*</font>内际金额</td>
<td><input id='txtnjprice' type='text' style='width: 50%' precision="2" min="0" max="99999" columnname="njprice" columndesc="内际金额" columnrequired="true" value="0" /><a id="a_njprice" style="color:red"></a></td> <td class="f1" ><font color="red">*</font>海运费</td>
<td><input id='txthyprice' type='text' style='width: 50%' precision="2" min="0" max="99999" columnname="hyprice" columndesc="海运费" columnrequired="true" value="0"/><a id="a_hyprice" style="color:red"></a></td>
</tr>
<tr>
<td class="f1" >0 未结清 1已结清 </td>
<td><select id='liststate' style="width: 99%;" columnname="state" columndesc="0 未结清 1已结清 " columnrequired="false" binding="BindComboBox2" url="XXX.asmx/XXX" modelid="Id" modelname="Name" TopName=""></select></td>
</tr>
<tr>
<td colspan="4" align="center">
@ -389,6 +830,58 @@
</td>
</tr>
</table>
</div>
<div id="MainTable2" title="编辑" style="width:800px; height: auto;">
<table class="tableAll" style="width: 100%;">
<tr>
<td colspan="4">
<font color="red">注:如要删除支付记录,请按日期从最新的那条开始删除,否则还原欠费数据会有问题</font><br />
<div id="DataGrid2" class="DataGridStyle"></div>
</td>
</tr>
</table>
</div>
<div id="MainTable3" title="编辑" style="width:800px; height: auto;">
<table class="tableAll" style="width: 100%;">
<tr>
<td class="f1" ><font color="red">*</font>欠费金额(欠费+利息)</td>
<td><input id='txtjsbprice' type='text' style='width: 90%' precision="2" min="0" max="99999" columnname="jsbprice" columndesc="欠费金额" columnrequired="true" /><a id="a_bz"></a></td>
<td class="f1" ><font color="red">*</font>结算币种</td>
<td><select id='listfeetype2' style="width: 99%;" columnname="feetype" columndesc="结算币种" columnrequired="true">
<option value="1">人民币结算</option>
<option value="2">美金结算</option>
</select></td>
</tr>
<tr>
<td class="f1" ><font color="red">*</font>支付日期</td>
<td><input id='txtfeedate' type='text' style='width: 99%' onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" columnname="feedate" columndesc="支付日期" columnrequired="true" validtype="" columnformat="yyyy-MM-dd" /></td> <td class="f1" >结算汇率</td>
<td><input id='txthlrate2' type='text' style='width: 99%' precision="2" min="0" max="99999" columnname="hlrate" columndesc="结算汇率" columnrequired="true" /></td>
</tr>
<tr>
<td class="f1" ><font color="red">*</font>结算金额</td>
<td><input id='txtfeejsprice' type='text' style='width: 50%' precision="2" min="0" max="99999" columnname="feejsprice" columndesc="结算金额" columnrequired="true" /><a id="a_feejsprice" style="color:red"></a></td>
<td></td> <td></td>
<%-- <td><select id='liststate' style="width: 99%;" columnname="feetype" columndesc="结算状态" columnrequired="true">
<option value="0">未结清</option>
<option value="1">已结清</option>
</select></td>--%>
</tr>
<tr>
<td colspan="4" align="center">
<input id="cmdSave2" type="button" value="保存" onclick="SaveFeeDetail()" />
</td>
</tr>
</table>
</div>
</div>

@ -135,7 +135,10 @@
GetTemuGoodPriceCheckQty();
}
$("#sp21").bind("click", function(){
window.open("HT_CustomList.aspx");
});
if (UserId!=1&&UserId!=51)
$("#div_1,#div_3,#div_21,#div_22,#div_23,#div_24").hide();
$("#leftmenu-trigger").click(function () {
@ -197,7 +200,7 @@
});
$("#sp_name,#a_name").html(name);
if (UserId == 1 || UserId == 53)
$("#tr_ck,#tr_ck2,#a_33,#a_333,#a_grxs2,#sp_Num8,#sp_Num88,#sp12,#sp15").show();
$("#tr_ck,#tr_ck2,#a_33,#a_333,#a_grxs2,#sp_Num8,#sp_Num88,#sp12,#sp15,#sp21").show();
if (UserId == 51 || UserId == 114 || UserId == 190)
$("#sp_Num8").show();
if (UserId == 225) {
@ -2728,6 +2731,8 @@
<span class="sp_1" id="sp18" >店铺索赔</span><br />
<span class="sp_1" id="sp20" >人员订单销售数据</span><br />
<%-- <span class="sp_1" id="sp19" >店铺邮件</span><br />--%>
<span class="sp_1" id="sp21" style="display:none;color:red">借款合同填写</span><br />
<canvas height="20" width="80"></canvas></div>
</div>
</a>

@ -11443,6 +11443,8 @@ namespace TradeManageNew
/// id
/// </summary>
public Int32? id { get; set; }
public Int32? feetype { get; set; }
/// <summary>
/// 客户
/// </summary>
@ -11467,6 +11469,7 @@ namespace TradeManageNew
/// usdprice
/// </summary>
public Decimal? usdprice { get; set; }
public Decimal? zfprice { get; set; }
/// <summary>
/// 内际金额
/// </summary>
@ -11483,10 +11486,12 @@ namespace TradeManageNew
/// 利率
/// </summary>
public Decimal? llrate { get; set; }
/// <summary>
/// totalrmbprice
/// </summary>
public Decimal? totalrmbprice { get; set; }
public Decimal? lxprice2 { get; set; }
public DateTime? predate { get; set; }
/// <summary>
/// totalrmbprice
/// </summary>
public Decimal? totalrmbprice { get; set; }
/// <summary>
/// totalusdprice
/// </summary>
@ -11495,10 +11500,19 @@ namespace TradeManageNew
/// 已付多少
/// </summary>
public Decimal? yfprice { get; set; }
public Decimal? leftprice { get; set; }
public String feeflag { get; set; }
/// <summary>
/// 累计利息多少
///应付金额
/// </summary>
public Decimal? lxprice { get; set; }
public Decimal? njrmbprice { get; set; }
public Decimal? hyrmbprice { get; set; }
public Decimal? yjrmbprice { get; set; }
public Decimal? yjrate { get; set; }
/// <summary>
/// inname
/// </summary>
@ -11507,6 +11521,11 @@ namespace TradeManageNew
/// indate
/// </summary>
public DateTime? indate { get; set; }
public DateTime? jxdate { get; set; }
public Int32? days { get; set; }
public Int32? days2 { get; set; }
/// <summary>
/// 0 未结清 1已结清
/// </summary>
@ -11527,6 +11546,8 @@ namespace TradeManageNew
/// 支付日期
/// </summary>
public DateTime? feedate { get; set; }
/// <summary>
/// feermbprice
/// </summary>
@ -11546,10 +11567,17 @@ namespace TradeManageNew
/// <summary>
/// 结算时欠费金额
/// </summary>
public Decimal? jsbprice { get; set; }
public string jsbprice { get; set; }
/// <summary>
/// 结算时产生的总利息
/// </summary>
public Decimal? jslxprice { get; set; }
/// <summary>
/// 还款金额
/// </summary>
public Decimal? hkprice { get; set; }
public Decimal? leftprice { get; set; }
}
}

@ -18120,6 +18120,26 @@ where a.storeid in (6,9,11) and a.OrderGoodsId=0 and a.KCNum>0 " + tj + " gr
public int Save_CustomFee(HT_CustomFee Model)
{
PagesNew.Login(this.Session);
Model.indate = DateTime.Now;
Model.inname = Session["Name"].ToString();
if (Model.jxdate == null)
Model.jxdate = Model.htdate;
Model.state = 0;
Model.yjprice = Model.usdprice * Model.yjrate*0.01M;
Model.yjrmbprice = Model.rmbprice * Model.yjrate * 0.01M;
Model.yfprice = 0;
if (Model.feetype == 1)
{
Model.lxprice = Model.rmbprice + Model.yjrmbprice + Model.njrmbprice + Model.hyrmbprice;
}
else if (Model.feetype == 2)
{
Model.lxprice = Model.usdprice + Model.yjprice + Model.njprice + Model.hyprice;
}
return DataNew.Save_CustomFee(Model);
}
#endregion
@ -18160,6 +18180,34 @@ where a.storeid in (6,9,11) and a.OrderGoodsId=0 and a.KCNum>0 " + tj + " gr
int RowCount = 0;
resultModel.DataSource = DataNew.GetListCustomFee(where, PageIndex, PageSize, "", out RowCount);
resultModel.RowCount = RowCount;
if (resultModel.DataSource != null)
{
foreach (var md in resultModel.DataSource)
{
md.lxprice2 = 0;
if (md.state == 0)
{
if (md.days2>=0)
md.lxprice2 = md.lxprice * md.llrate * md.days2;
else if (md.days>= 0)
md.lxprice2 = md.lxprice * md.llrate * md.days;
// md.leftprice = md.lxprice - md.yfprice;
}
else
{
md.leftprice = 0;
}
if (md.days2 >= 0)
md.days = md.days2;
if (md.days < 0)
md.days = 0;
if (md.days2 < 0)
md.days2 = 0;
md.feeflag = "¥";
if (md.feetype == 2)
md.feeflag = "$";
}
}
return resultModel;
}
#endregion

Loading…
Cancel
Save