You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

894 lines
36 KiB
Plaintext

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HT_CustomList.aspx.cs" Inherits="TradeManageNew.HT_CustomList" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>客户合同</title>
<link rel="stylesheet" type="text/css" href="css2/icon.css">
<link rel="stylesheet" type="text/css" href="css2/DataGrid.css" />
<script src="Scripts2/MicrosoftAjax.js" type="text/javascript"></script>
<script src="Scripts2/jquery.min.js" type="text/javascript"></script>
<script src="Scripts2/jquery.easyui.min.js" type="text/javascript"></script>
<script src="Scripts2/DataGrid.js?t=1" type="text/javascript"></script>
<script src="Scripts2/DataPager.js?t=1" type="text/javascript"></script>
<script src="Scripts2/Global.js?t=1" type="text/javascript"></script>
<script src="Scripts2/WindowLoad.js?t=1" type="text/javascript"></script>
<link href="css2/gray/easyui.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" />
<link href="css2/New.css" rel="stylesheet" type="text/css" />
<link href="Scripts2/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet" />
<script src="Scripts2/fancybox/jquery.fancybox-1.3.4.js" type="text/javascript"></script>
<script src="Scripts2/MaskedTextBox.js?t=1" type="text/javascript"></script>
<script src="Scripts/ajaxfileupload.js" type="text/javascript"></script>
<script src="Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="Scripts2/jquery.url.js" type="text/javascript"></script>
<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 () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
//var CurrentDate = new Date();
//$("#txt_StartDate").val(CurrentDate.localeFormat("yyyy-MM-01"));
//$("#txt_StopDate").val(CurrentDate.localeFormat("yyyy-MM-dd"));
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"); //清空内容
//var CurrentDate = new Date();
//$("#txtInDate").val(CurrentDate.localeFormat("yyyy-MM-dd"));
ShowFancybox("MainTable");
});
$("#cmdGet").click(function () {
ReadData();
});
$("#cmdSave").click(function () {
Save();
});
$("#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.HeaderText = "客户";
col.CellTemplate ="<span>{Bind customname}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "合同日期";
col.CellTemplate ="<span>{Bind htdate,yyyy-MM-dd}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "合同编号 ";
col.CellTemplate ="<span>{Bind htcode}</span>";
Array.add(datagrid1.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(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "金额";
col.CellTemplate ="<span>${Bind usdprice}【¥{Bind rmbprice}】</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
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}【¥{Bind njrmbprice}】</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "海运费";
col.CellTemplate ="<span>${Bind hyprice}【¥{Bind hyrmbprice}】</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "汇率";
col.CellTemplate ="<span>{Bind hlrate}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "利率";
col.CellTemplate ="<span>{Bind llrate}/天</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "计息日期";
col.CellTemplate = "<span>{Bind jxdate,yyyy-MM-dd}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
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 feeflag}{Bind yfprice}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
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);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "创建时间";
col.CellTemplate ="<span>{Bind indate,yyyy-MM-dd}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
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 = "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);
datagrid1.IsFixHeader = false;
datagrid1.ShowIndexColumn = false;
datagrid1.AllowPaging = true;
datagrid1.Width = "100%";
datagrid1.SelectMode = nblf.ui.SelectMode.None;
datagrid1.Init();
datagrid1.add_PageIndexChanged(function () { ReadData(); });
}
//#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();
CreateWhere("SelectHtml", param); //读取查询条件
param.cs = Base64.encode(param.cs);
param.PageIndex = datagrid1.Get_PageIndex();
param.PageSize = datagrid1.Get_PageSize();
$.ajax({
url: "SysManageServiceNew.asmx/GetListCustomFee",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
}
});
}
//#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;
var param = new Object();
param.id = id;
WindowLoadModel.Show();
$.ajax({
url: "SysManageServiceNew.asmx/Delete_CustomFee",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
if (data.d == false) { alert("已经使用过,无法删除"); return; }
ReadData(); //刷新DataGrid
}
});
}
//#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",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
ReadData();
alert("保存成功");
$.fancybox.close();
}
});
}
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) {
$.fancybox({
'scrolling': 'no',
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'href': '#' + id,
'onClosed': function () {
}
}, 0);
}
//#endregion
</script>
</head>
<body>
<table id="SelectHtml" border="1" cellpadding="0" cellspacing="0" align="center" style="width: 100%"
class="tableAll">
<colgroup>
<col style="width: 60px;" />
<col style="width: 240px;" />
<col style="width: 60px;" />
<col style="width: 120px;" />
<col style="width: 60px;" />
<col style="width: 120px;" />
<col style="width: 60px;" />
<col style="width: 120px;" />
<col />
</colgroup>
<tr>
<td class="f1" >客户</td>
<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" >状态</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>
<tr>
<td colspan="9">
<input id="cmdAdd" type="button" value="新增" /><font color="red">注:未支付过的按计息日期计算利息,有已支付记录的按上次支付日期开始计算利息(因为上次支付时已经把利息结算到总金额去了)</font>
</td>
</tr>
<tr>
<td valign="top" colspan="9">
<div id="DataGrid1" class="DataGridStyle"></div>
</td>
</tr>
</table>
<div style="display: none;">
<div id="MainTable" title="编辑" style="width:700px; height: auto;">
<table class="tableAll" style="width: 100%;">
<colgroup>
<col style="width: 120px;" />
<col />
<col style="width: 120px;" />
<col />
</colgroup>
<tr>
<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>
</tr>
<tr>
<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" ><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='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" ><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>
</tr>
<tr>
<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>
</tr>
<tr>
<td colspan="4" align="center">
<input id="cmdSave" type="button" value="保存" />
<input id="cmdBack" type="button" value="返回" />
</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>
</body>
</html>