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.
374 lines
14 KiB
Plaintext
374 lines
14 KiB
Plaintext
1 month ago
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CompanyFeeList.aspx.cs" Inherits="TradeManage.SysManage.CompanyFeeList" %>
|
||
|
|
||
|
<!DOCTYPE html>
|
||
|
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head id="Head1" runat="server">
|
||
|
<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>
|
||
|
<script src="../Scripts2/jquery.url.js" type="text/javascript"></script>
|
||
|
<link href="../css2/gray/easyui.css" rel="stylesheet" type="text/css" />
|
||
|
<link href="../css2/gray/icon.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" />
|
||
|
<script src="../My97DatePicker/WdatePicker.js?t=1"></script>
|
||
|
<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 type="text/javascript">
|
||
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
||
|
var WindowLoadModel = new WindowLoad();
|
||
|
var Model = null;
|
||
|
var CompanyId = 0;
|
||
|
var CompanyId2 = "<%=Session["CompanyId"]%>";
|
||
|
$(document).ready(function () {
|
||
|
WindowLoadModel.ApplicationPath = "../";
|
||
|
WindowLoadModel.Load();
|
||
|
ajaxInit(WindowLoadModel);
|
||
|
GetCompanyList();
|
||
|
//var CurrentDate = new Date();
|
||
|
//$("#txt_StartDate").val(CurrentDate.localeFormat("yyyy-MM-01"));
|
||
|
//$("#txt_StopDate").val(CurrentDate.localeFormat("yyyy-MM-dd"));
|
||
|
if(CompanyId2==1)
|
||
|
{
|
||
|
$("#tr1").show();
|
||
|
}
|
||
|
CompanyId = $.url.param("CompanyId");
|
||
|
if (CompanyId == undefined) {
|
||
|
CompanyId = 0;
|
||
|
}
|
||
|
|
||
|
$("#select_company,#select_company2").val(CompanyId);
|
||
|
|
||
|
CreateDataGrid();
|
||
|
ReadData();
|
||
|
|
||
|
$("#cmdAdd").click(function () {
|
||
|
ShowFancybox("test");
|
||
|
$("#txt_Money").val("");
|
||
|
});
|
||
|
|
||
|
$("#cmdGet").click(function () {
|
||
|
ReadData();
|
||
|
});
|
||
|
|
||
|
$("#cmdSave").click(function () {
|
||
|
Save();
|
||
|
});
|
||
|
|
||
|
$("#cmdBack").click(function () {
|
||
|
$("#SelectHtml").show();
|
||
|
$("#MainTable").hide();
|
||
|
});
|
||
|
|
||
|
$("#cmdExportExcel").click(function () {
|
||
|
ExportExcel();
|
||
|
});
|
||
|
|
||
|
|
||
|
$("#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.State == 1 || Model.State == 2) { $("#cmdSave").hide(); }
|
||
|
//else { $("#cmdSave").show(); }
|
||
|
//if (Model.State == 2) { $("#tr1").show(); }
|
||
|
//else { $("#tr1").hide(); }
|
||
|
CreateGetModel("MainTable", Model);
|
||
|
$("#SelectHtml").hide();
|
||
|
$("#MainTable").show();
|
||
|
}
|
||
|
if (CommandName == "cmdDel") {
|
||
|
Delete(Model.Id);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
});
|
||
|
function GetCompanyList() {
|
||
|
|
||
|
//$("#select_company").append("<option value='0'>选择</option>")
|
||
|
|
||
|
$.ajax({
|
||
|
url: "../SysManageServiceNew.asmx/GetListCompany3",
|
||
|
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
dataType: "json",
|
||
|
async: false,
|
||
|
success: function (data) {
|
||
|
if (data.d != null) {
|
||
|
$(data.d).each(function () {
|
||
|
$("#select_company,#select_company2").append("<option value='" + this.ID + "'>" + this.Name + "</option>")
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
}
|
||
|
//#region 初始化DataGrid
|
||
|
function CreateDataGrid() {
|
||
|
|
||
|
var col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "客户单位";
|
||
|
col.CellTemplate = "<span>{Bind CompanyName}</span>";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "充值日期";
|
||
|
col.CellTemplate = "<span>{Bind InDate,yyyy-MM-dd HH:mm}</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 InFee}¥</span>";
|
||
|
// Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "充值金额$";
|
||
|
col.CellTemplate = "<span>{Bind InUSDFee}$</span>";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
if(CompanyId2==1)
|
||
|
{
|
||
|
|
||
|
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(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 读取数据
|
||
|
function ReadData() {
|
||
|
var param = new Object();
|
||
|
CreateWhere("SelectHtml", param); //读取查询条件
|
||
|
param.cs += " and a.CompanyId=" + $("#select_company").val();
|
||
|
param.cs = Base64.encode(param.cs);
|
||
|
param.PageIndex = datagrid1.Get_PageIndex();
|
||
|
param.PageSize = datagrid1.Get_PageSize();
|
||
|
$.ajax({
|
||
|
url: "../CangKuServerNew.asmx/GetListCompanyFee",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
datagrid1.Set_RowCount(data.d.RowCount);
|
||
|
datagrid1.DataBind(data.d.DataSource);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#endregion
|
||
|
//#region 删除
|
||
|
function Delete(Id) {
|
||
|
if (window.confirm("确定要删除吗?") == false) return;
|
||
|
var param = new Object();
|
||
|
param.Id = Id;
|
||
|
WindowLoadModel.Show();
|
||
|
$.ajax({
|
||
|
url: "../CangKuServerNew.asmx/Delete_CompanyFee",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
WindowLoadModel.Hide();
|
||
|
// if (data.d == false) { alert("已经使用过,无法删除"); return; }
|
||
|
ReadData(); //刷新DataGrid
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#endregion
|
||
|
//#region 保存
|
||
|
function Save() {
|
||
|
var error = CreateSaveModel("MainTable", Model);
|
||
|
if (error != "") { alert(error); return; }
|
||
|
var param = new Object();
|
||
|
param.Model = Model;
|
||
|
WindowLoadModel.Show();
|
||
|
$.ajax({
|
||
|
url: "SysManageService.asmx/Save_CompanyFee",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
WindowLoadModel.Hide();
|
||
|
ReadData();
|
||
|
alert("保存成功");
|
||
|
$("#SelectHtml").show();
|
||
|
$("#MainTable").hide();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#endregion
|
||
|
//#region 导出Excel
|
||
|
function ExportExcel() {
|
||
|
var param = new Object();
|
||
|
CreateWhere("SelectHtml", param); //读取查询条件
|
||
|
$.ajax({
|
||
|
url: "XXX.asmx/GetListCompanyFee_ExportExcel",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
var params = { FilePath: data.d, FileName: "外出记录.xls" };
|
||
|
window.location = "../GlobalAshx/DownFile.ashx?" + jQuery.param(params);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#endregion
|
||
|
|
||
|
//#region 显示弹出窗体
|
||
|
function ShowFancybox(id) {
|
||
|
$.fancybox({
|
||
|
'scrolling': 'no',
|
||
|
'autoScale': false,
|
||
|
'transitionIn': 'elastic',
|
||
|
'transitionOut': 'elastic',
|
||
|
'href': '#' + id,
|
||
|
'onClosed': function () {
|
||
|
|
||
|
}
|
||
|
}, 0);
|
||
|
}
|
||
|
//#endregion
|
||
|
|
||
|
//#region 保存
|
||
|
function SaveMoney() {
|
||
|
if ($("#txt_Money").val() == "") {
|
||
|
alert("请输入充值金额");
|
||
|
return;
|
||
|
}
|
||
|
if ($("#txtInDate").val() == "") {
|
||
|
alert("请输入充值日期");
|
||
|
return;
|
||
|
}
|
||
|
var model = new Object();
|
||
|
model.InUSDFee = $("#txt_Money").val();
|
||
|
model.CompanyId = $("#select_company2").val();
|
||
|
model.InDate = $("#txtInDate").val();
|
||
|
var param = new Object();
|
||
|
param.model = model;
|
||
|
WindowLoadModel.Show();
|
||
|
$.ajax({
|
||
|
url: "../CangKuServerNew.asmx/SaveCZMoney",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
WindowLoadModel.Hide();
|
||
|
ReadData();
|
||
|
alert("保存成功");
|
||
|
$.fancybox.close();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#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>
|
||
|
<select id="select_company" class="selectClass" style="width: 200px" name="D1">
|
||
|
</select></td>
|
||
|
<td class="f1" > </td>
|
||
|
<td> </td>
|
||
|
<td> </td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="f1" >充值日期</td>
|
||
|
<td><input id="txt_StartDate" type="text" style="width: 100px; " onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" where="a.InDate>='@value'" />-<input id="txt_StopDate" type="text" style="width: 100px; " onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" where="a.InDate<= '@value 23:59:59'" /></td>
|
||
|
<td class="f1" >操作人</td>
|
||
|
<td><input id='txt_InName' type='text' style='width: 99%' where="a.InName like '%@value%'"/></td>
|
||
|
<td><input id="cmdGet" type="button" value = "查询" /></td>
|
||
|
</tr>
|
||
|
|
||
|
<tr id="tr1" style="display:none">
|
||
|
<td colspan="5">
|
||
|
<input id="cmdAdd" type="button" value="录入费用" />
|
||
|
<%-- <input id="cmdExportExcel" type="button" value = "导出" />--%>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top" colspan="5">
|
||
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<div style="display: none;">
|
||
|
<div id="test" title="编辑" style="width: 400px; height: 200px;">
|
||
|
<table class="tableAll" style="width: 99%;">
|
||
|
<tr>
|
||
|
<td class="f1">客户单位:
|
||
|
</td>
|
||
|
<td colspan="3">
|
||
|
<select id="select_company2" class="selectClass" style="width: 200px" name="D1">
|
||
|
</select>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="f1">充值金额:
|
||
|
</td>
|
||
|
<td colspan="3">
|
||
|
<input id='txt_Money' type='text' style='width:100px' />$
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="f1">充值日期:
|
||
|
</td>
|
||
|
<td colspan="3">
|
||
|
<input id='txtInDate' type='text' style='width:100px' onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" />
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="4" align="center">
|
||
|
<input id="Button1" class="btnClass btnClassSave" type="button" value="保存" onclick="SaveMoney();" />
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|
||
|
|
||
|
|