|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CaiWuBiTian.aspx.cs" Inherits="TradeManageNew.CaiWu.CaiWuBiTian" %>
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
<head>
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
<title>财务数据</title>
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
|
|
|
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/jquery.min.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/DataGrid.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/DataPager.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/jquery.url.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/jquery.bgiframe.min.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/Global.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
|
|
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.css"
|
|
|
media="screen" />
|
|
|
<script type="text/javascript" src="../Scripts/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
|
|
|
<script type="text/javascript" src="../Scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
|
var UserId = "<%=Session["UserId"]%>";
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
var Id = 0;
|
|
|
$(document).ready(function () {
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
WindowLoadModel.Load();
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
|
|
CreateDataGrid();
|
|
|
|
|
|
$("#txt_ba,#txt_ca,#txt_fn,#txt_fd").MaskedTextBox();
|
|
|
ReadData();
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [CommandName='cmdEdit']").live("click", function () {
|
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
Id = model.ID;
|
|
|
Clear();
|
|
|
if (model.InDate != null)
|
|
|
$("#txt_InDate").val(model.InDate.localeFormat("yyyy-MM-dd"));
|
|
|
|
|
|
$("#txt_ba").val(model.BA);
|
|
|
$("#txt_ca").val(model.CA);
|
|
|
$("#txt_fn").val(model.FN);
|
|
|
$("#txt_fd").val(model.FD);
|
|
|
$("#txt_hl").val(model.Rate);
|
|
|
|
|
|
fopen();
|
|
|
});
|
|
|
|
|
|
$("#btn_add").bind("click", function () {
|
|
|
Clear();
|
|
|
Id = 0;
|
|
|
fopen();
|
|
|
GetRate();
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#btn_sch").bind("click", function () {
|
|
|
ReadData();
|
|
|
});
|
|
|
|
|
|
|
|
|
});
|
|
|
function Clear() {
|
|
|
|
|
|
$("#txt_InDate").val("");
|
|
|
$("#txt_ba").val("");
|
|
|
$("#txt_ca").val("");
|
|
|
$("#txt_fn").val("");
|
|
|
$("#txt_fd").val("");
|
|
|
$("#txt_hl").val("");
|
|
|
}
|
|
|
|
|
|
function fopen() {
|
|
|
|
|
|
$.fancybox({
|
|
|
'width': '40%',
|
|
|
'height': '40%',
|
|
|
'autoScale': false,
|
|
|
'transitionIn': 'elastic',
|
|
|
'transitionOut': 'elastic',
|
|
|
'href': '#test',
|
|
|
'onComplete': function () {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function fopen() {
|
|
|
|
|
|
$.fancybox({
|
|
|
'width': '40%',
|
|
|
'height': '40%',
|
|
|
'autoScale': false,
|
|
|
'transitionIn': 'elastic',
|
|
|
'transitionOut': 'elastic',
|
|
|
'href': '#test',
|
|
|
'onComplete': function () {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
//#endregion
|
|
|
//#region 初始化DataGrid
|
|
|
function CreateDataGrid() {
|
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "Date";
|
|
|
col.CellTemplate = "<a>{Bind InDateStr}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "WI";
|
|
|
col.CellTemplate = "<a>${Bind WI}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "EI";
|
|
|
col.CellTemplate = "<a>${Bind EI}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "OI";
|
|
|
col.CellTemplate = "<span>¥{Bind OI}</span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "KI";
|
|
|
col.CellTemplate = "<a>¥{Bind KI}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "BA";
|
|
|
col.CellTemplate = "<span>${Bind BA}</span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "CA";
|
|
|
col.CellTemplate = "<span>¥{Bind CA}</span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "FAM";
|
|
|
col.CellTemplate = "<span>${Bind FAM}</span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "FN";
|
|
|
col.CellTemplate = "<span>¥{Bind FN}</span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "FD";
|
|
|
col.CellTemplate = "<span>¥{Bind FD}</span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "Rate";
|
|
|
col.CellTemplate = "<span>{Bind Rate}</span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "TOTAL";
|
|
|
col.CellTemplate = "<span>¥{Bind TOTAL}</span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "操作";
|
|
|
col.Width = "180px";
|
|
|
col.CellTemplate = "<input CommandName='cmdEdit' class='btnClass dgbtnEdit' type='button' value='编辑'></input> <input onclick='DelCol(this)' class='btnClass dgbtnDel' type='button' value='删除'></input>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
datagrid1.SetPageSize(30);
|
|
|
datagrid1.SetPageIndex(1);
|
|
|
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 读取数据
|
|
|
function ReadData() {
|
|
|
|
|
|
var param = new Object();
|
|
|
param.SDate = $("#txtSDate").val();
|
|
|
param.EDate = $("#txtEDate").val();
|
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../SysManageServiceNew.asmx/GetFinanceFundDataList",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
datagrid1.Set_RowCount(data.d.RowCount);
|
|
|
datagrid1.DataBind(data.d.DataSource);
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
//#region 删除
|
|
|
function DelCol(obj) {
|
|
|
if (window.confirm('确定要删除吗?') == false) return;
|
|
|
var rowindex = $(obj).parent().parent().attr("index");
|
|
|
var param = new Object();
|
|
|
var model = datagrid1.Get_Model(rowindex);
|
|
|
|
|
|
param.id = model.ID;
|
|
|
|
|
|
$.ajax({
|
|
|
url: "../SysManageServiceNew.asmx/DeleteFinanceFundData",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
alert("删除成功");
|
|
|
ReadData();
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
}
|
|
|
function save() {
|
|
|
if ($("#txt_InDate").val() == "") {
|
|
|
alert("请填写数据日期");
|
|
|
return;
|
|
|
}
|
|
|
var md = new Object();
|
|
|
var param = new Object();
|
|
|
md.Id = Id;
|
|
|
md.InDate = $("#txt_InDate").val();
|
|
|
|
|
|
if ($("#txt_hl").val() == "") {
|
|
|
alert("汇率不能为空");
|
|
|
return;
|
|
|
}
|
|
|
md.Rate = $("#txt_hl").val();
|
|
|
|
|
|
if ($("#txt_ba").val() == "") {
|
|
|
alert("BA不能为空");
|
|
|
return;
|
|
|
}
|
|
|
md.BA = $("#txt_ba").val();
|
|
|
|
|
|
if ($("#txt_ca").val() == "") {
|
|
|
alert("CA不能为空");
|
|
|
return;
|
|
|
}
|
|
|
md.CA = $("#txt_ca").val();
|
|
|
|
|
|
if ($("#txt_fn").val() == "") {
|
|
|
alert("FN不能为空");
|
|
|
return;
|
|
|
}
|
|
|
md.FN = $("#txt_fn").val();
|
|
|
|
|
|
if ($("#txt_fd").val() == "") {
|
|
|
alert("FD不能为空");
|
|
|
return;
|
|
|
}
|
|
|
md.FD = $("#txt_fd").val();
|
|
|
|
|
|
param.Model = md;
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../SysManageServiceNew.asmx/SaveFinanceFundData",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
alert("保存成功");
|
|
|
ReadData();
|
|
|
$.fancybox.close();
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
///获取昨天的汇率
|
|
|
function GetRate() {
|
|
|
$.ajax({
|
|
|
url: "../SysManageServiceNew.asmx/GetLastDayFinanceFundRateData",
|
|
|
//data: Sys.Serialization.JavaScriptSerializer.serialize(),
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
$("#txt_hl").val(data.d);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
//#endregion
|
|
|
</script>
|
|
|
|
|
|
|
|
|
</head>
|
|
|
<body class="headbody">
|
|
|
<div style="display: none">
|
|
|
<div id="test" title="供应商" style="width: 680px; height: 390px;">
|
|
|
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
|
|
|
<tr>
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
<font color="red" style="font-weight: bolder">*</font>数据日期:
|
|
|
</td>
|
|
|
<td>
|
|
|
<input id="txt_InDate" class="editTextbox" style="width: 120px;" type="text" onfocus="WdatePicker()" />
|
|
|
</td>
|
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
<font color="red" style="font-weight: bolder">*</font>汇率:
|
|
|
</td>
|
|
|
<td>
|
|
|
<input id="txt_hl" min='0' max='1000000000' precision='2' class="editTextbox" style="width:75%;" type="text" />
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
<font color="red" style="font-weight: bolder">*</font>BA:
|
|
|
</td>
|
|
|
<td>
|
|
|
<input id="txt_ba" min='0' max='1000000000' precision='2' class="editTextbox" style="width:75%;" type="text" />
|
|
|
</td>
|
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
<font color="red" style="font-weight: bolder">*</font>CA:
|
|
|
</td>
|
|
|
<td>
|
|
|
<input id="txt_ca" min='0' max='1000000000' precision='2' class="editTextbox" style="width:75%;" type="text" />
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
<font color="red" style="font-weight: bolder">*</font>FN:
|
|
|
</td>
|
|
|
<td>
|
|
|
<input id="txt_fn" min='0' max='1000000000' precision='2' class="editTextbox" style="width:75%;" type="text" />
|
|
|
</td>
|
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
<font color="red" style="font-weight: bolder">*</font>FD:
|
|
|
</td>
|
|
|
<td>
|
|
|
<input id="txt_fd" min='0' max='1000000000' precision='2' class="editTextbox" style="width:75%;" type="text" />
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
<td align="center" colspan="4">
|
|
|
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="保 存" onclick="save();" /> <input
|
|
|
id="btn_Cancel" type="button" class="btnClass btnClassClose" value="关 闭" />
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
<div class="title_ico">
|
|
|
财务数据
|
|
|
</div>
|
|
|
|
|
|
<table id="tb1" class="tableAll" style="width: 100%;">
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td class="f1" width="13%">日期:</td>
|
|
|
<td>
|
|
|
<input id="txtSDate" class="editTextbox" style="width: 120px;" type="text" onfocus="WdatePicker()" autocomplete="off" />-<input id="txtEDate" class="editTextbox" style="width: 120px;" type="text" onfocus="WdatePicker()" autocomplete="off" /></td>
|
|
|
|
|
|
|
|
|
<td>
|
|
|
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td colspan="5" class="auto-style1">
|
|
|
<input id="btn_add" class="btnClass btnClassAdd" type="button" value="新增" />
|
|
|
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td valign="top" colspan="5">
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
</body>
|
|
|
</html>
|