@ -48,7 +48,7 @@
CreateDataGrid();
CreateDataGrid2();
ReadData();
$("#cmdAdd").click(function () {
$("#a_zhprice").html("");
num = 0;
@ -91,6 +91,12 @@
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(); }
@ -118,6 +124,7 @@
if (CommandName == "cmdDetail") {
// CreateGetModel("MainTable", Model);
ReadData2(Model.id);
ShowFancybox("MainTable2");
}
if (CommandName == "cmdFee") {
@ -127,18 +134,30 @@
return;
}
// CreateGetModel("MainTable", Model);listfeetype2 txthlrate2
$("#txtjsbprice").val(Model.lxprice);
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;
@ -353,7 +372,7 @@
col = new nblf.ui.DataGridColumn();
col.HeaderText = "金额";
col.CellTemplate ="<span>${Bind usdprice}【¥{Bind usd price}】</span>";
col.CellTemplate ="<span>${Bind usdprice}【¥{Bind rmb price}】</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "佣金";
@ -396,19 +415,26 @@
//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 feeflag}{Bind lxprice}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
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 feeflag}{Bind leftprice}</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 = "当前利息";
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);
@ -438,14 +464,14 @@
col = new nblf.ui.DataGridColumn();
col.HeaderText = "付款明细";
col.Width = "160px";
col.CellTemplate = "<span CommandName='cmdDetail' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>付款明细</span>";
col.CellTemplate = "<span CommandName='cmdDetail' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>付款明细</span> <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 = "16 0px";
col.CellTemplate = "<span CommandName='cmdEdit' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>编辑</span> <span CommandName='cmdFee' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>付款</span> <span CommandName='cmd Del' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>删除</span>";
col.Width = "12 0px";
col.CellTemplate = "<span CommandName='cmdEdit' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>编辑</span> <span CommandName='cmdDel' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>删除</span>";
Array.add(datagrid1.Columns, col);
//datagrid1.SetPageSize(20);
@ -469,53 +495,47 @@
col.HeaderText = "支付日期";
col.CellTemplate = "<span>{Bind feedate,yyyy-MM-dd}</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "feermbprice";
col.CellTemplate = "<span>{Bind feermbprice}</span>";
Array.add(datagrid2.Columns, col);
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 = "feeusdprice";
col.CellTemplate = "<span>{Bind feeusdprice}</span>";
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 = "1人民币结算 2美金结算";
col.CellTemplate = "<span>{Bind feetype}</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.CellTemplate = "<span>{Bind jslxprice}</span>";
Array.add(datagrid2.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> <span CommandName='cmd Del' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>删除</span>";
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 = tru e;
datagrid2.AllowPaging = fals e;
datagrid2.Width = "100%";
datagrid2.SelectMode = nblf.ui.SelectMode.None;
datagrid2.Init();
datagrid2.add_PageIndexChanged(function () { ReadData(); });
datagrid2.add_PageIndexChanged(function () { ReadData2 (); });
}
//#endregion
@ -536,6 +556,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;
@ -553,6 +589,25 @@
});
}
//#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);
@ -564,7 +619,7 @@
Model.usdprice = num;
Model.njrmbprice = $("#txtnjprice").val();
Model.njprice = num2;
Model.rmbprice = $("#txthyprice").val();
Model.hy rmbprice = $("#txthyprice").val();
Model.hydprice = num3;
}
else if (Model.feetype == 2) {
@ -589,11 +644,14 @@
});
}
var feetype = 1;
function SaveFeeDetail() {
var param = new Object();
if ($("#txtjsbprice").val() == "") {
alert("欠款金额没填"); return;
}
if ($("#txtfeedate").val() == "") {
alert("付款日期没填"); return;
@ -602,14 +660,14 @@
alert("汇率没填"); return;
}
if ($("#txtjsb price").val() == "") {
if ($("#txtfee jsprice").val() == "") {
alert("付款 金额没填"); return;
alert("结算 金额没填"); return;
}
var dmd = new Object();
dmd.feeid = Model.id;
dmd.jsbprice = $("#txtjsbprice").val();
dmd.jsbprice = $("#a_bz").html()+$("# txtjsbprice").val();
dmd.feetype = $("#listfeetype2").val();
dmd.hlrate = $("#txthlrate2").val();
dmd.feedate = $("#txtfeedate").val();
@ -623,7 +681,14 @@
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",
@ -683,7 +748,7 @@
<tr>
<td colspan="9">
<input id="cmdAdd" type="button" value="新增" />
<input id="cmdAdd" type="button" value="新增" /><font color="red">注:未支付过的按计息日期计算利息,有已支付记录的按上次支付日期开始计算利息(因为上次支付时已经把利息结算到总金额去了)</font>
</td>
</tr>
<tr>
@ -768,6 +833,7 @@
<tr>
<td colspan="4">
<font color="red">注:如要删除支付记录,请按日期从最新的那条开始删除,否则还原欠费数据会有问题</font><br />
<div id="DataGrid2" class="DataGridStyle"></div>
</td>
</tr>
@ -778,7 +844,7 @@
<tr>
<td class="f1" ><font color="red">*</font>欠费金额</td>
<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">
@ -794,11 +860,12 @@
<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 class="f1" ><font color="red">*</font>结算状态</td>
<td><select id='liststate' style="width: 99%;" columnname="feetype" columndesc="结算状态" columnrequired="true">
<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>
</select></td>--%>
</tr>