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.
264 lines
9.6 KiB
Plaintext
264 lines
9.6 KiB
Plaintext
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CK_FeeSet.aspx.cs" Inherits="TradeManageNew.CangKu.CK_FeeSet" %>
|
|
|
|
<!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" />
|
|
<meta http-equiv="pragma" content="no-cache" />
|
|
<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
|
|
<meta http-equiv="expires" content="0" />
|
|
<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 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" />
|
|
<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;
|
|
$(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();
|
|
ReadData();
|
|
|
|
$("#cmdAdd").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();
|
|
});
|
|
|
|
|
|
$("#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);
|
|
ShowFancybox("MainTable");
|
|
}
|
|
if (CommandName == "cmdDel") {
|
|
Delete(Model.Id);
|
|
}
|
|
if (CommandName == "cmdFee") {
|
|
window.location = "CK_FeeSetDetail.aspx?FeeId=" + Model.Id;
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
//#region 初始化DataGrid
|
|
function CreateDataGrid() {
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "费用名称";
|
|
col.CellTemplate = "<span>{Bind FeeDesc}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "";
|
|
col.CellTemplate = "<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 = "<a CommandName='cmdEdit' title='编辑' class='fa table_btn btn_edit'></a><a CommandName='cmdDel' title='删除' class='fa table_btn btn_del'></a>";
|
|
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 = Base64.encode(param.cs);
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
$.ajax({
|
|
url: "CangKuServer.asmx/GetListFeeList",
|
|
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: "CangKuServer.asmx/Delete_FeeList",
|
|
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: "CangKuServer.asmx/Save_FeeList",
|
|
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_FeeDesc' type='text' style='width: 99%' where="a.FeeDesc like '%@value%'"/></td>
|
|
<td><input id="cmdGet" type="button" value = "查询" /></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="9">
|
|
<input id="cmdAdd" type="button" value="新增" />
|
|
</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: 400px; height: auto;">
|
|
<table class="tableAll" style="width: 100%;">
|
|
<colgroup>
|
|
<col style="width: 80px;" />
|
|
<col />
|
|
</colgroup>
|
|
<tr>
|
|
<td class="f1" >费用名称</td>
|
|
<td><input id='txtFeeDesc' type='text' style='width: 99%' columnname="FeeDesc" columndesc="费用名称" columnrequired="true" validtype="" /></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="4" align="center">
|
|
<input id="cmdSave" type="button" value="保存" />
|
|
<input id="cmdBack" type="button" value="返回" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|