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.

254 lines
9.3 KiB
Plaintext

2 months ago
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HW_LowPriceList.aspx.cs" Inherits="TradeManage.HuoWu.HW_LowPriceList" %>
<!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/DateBox.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/jquery.url.js" type="text/javascript"></script>
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
<script src="../Scripts/jquery.cookies.min.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 src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var WindowLoadModel = new WindowLoad();
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
CreateDataGrid();
ReadData();
$("#" + datagrid1.TableID + " [CommandName='cmdLook']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
// window.location.href = "HW_GoodsInLook.aspx?Id=" + model.Id;
window.open("HW_GoodsAddForTM.aspx?GoodsId=" + model.GoodsId);
});
$("#btn_sch").bind("click", function () {
ReadData();
});
});
//#endregion
//#region 初始化DataGrid
function CreateDataGrid() {
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "货物新编号";
col.CellTemplate = "<a CommandName='cmdLook' class='linka'>{Bind GoodsCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "货物老编号";
col.CellTemplate = "<a CommandName='cmdLook' class='linka'>{Bind GoodsOldCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "货物名称";
col.CellTemplate = "<a>{Bind GoodsName}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "型号";
col.CellTemplate = "<a>{Bind TypeCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "描述";
col.CellTemplate = "<a>{Bind TypeDesc}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "压价金额";
col.CellTemplate = "<span>{Bind Price}</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.Width = "150px";
col.CellTemplate = "<input onclick='Delobj(this)' class='btnClass dgbtnDel' type='button' value='删除'></input>";
Array.add(datagrid1.Columns, col);
datagrid1.SetPageSize(40);
datagrid1.SetPageIndex(1);
datagrid1.IsFixHeader = false;
datagrid1.ShowIndexColumn = false;
datagrid1.AllowPaging = true;
datagrid1.Width = "100%";
datagrid1.SelectMode = nblf.ui.SelectMode.CheckBox;
datagrid1.Init();
datagrid1.add_PageIndexChanged(function () { ReadData(); });
}
function Delobj(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;
if (model.Id > 0) {
$.ajax({
url: "HuoWuService.asmx/DeleteBuyPriceOff",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
alert("删除成功");
datagrid1.Del_Row(rowindex);
}
});
}
}
//#endregion
//#region 读取数据
function ReadData() {
var param = new Object();
param.GoodsName = $("#txt_GoodsName").val();
param.SDate = null;
if ($("#txt_SDate").val() != "")
param.SDate = $("#txt_SDate").val();
param.EDate = null;
if ($("#txt_EDate").val() != "")
param.EDate = $("#txt_EDate").val();
// if ($("#txt_Edate").val() != "")
//param.Edate = null;
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
param.Sort = "Id desc";
WindowLoadModel.Show();
$.ajax({
url: "HuoWuService.asmx/GetListHW_BuyPriceOff",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
}
});
}
function DeleteYaJia() {
var SelectListModels = datagrid1.GetSelectListModel();
if (SelectListModels == null || $(SelectListModels).length == 0) {
alert("请选择要删除的订单");
return;
}
if (window.confirm('确定要删除该记录吗?') == false) return;
var Ids = "";
$(SelectListModels).each(function () {
Ids += this.Id + ",";
});
var param = new Object();
param.Ids = Ids;
$.ajax({
url: "HuoWuService.asmx/DeleteBuyPriceList",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
alert("删除成功");
ReadData();
}
});
}
</script>
</head>
<body class="headbody">
<form id="form1" runat="server">
<div class="title_ico">
压价记录
</div>
<table id="tb1" class="tableAll" style="width:100%;" >
<tr>
<td class="f1" width="13%">货物:</td>
<td width="15%">
<input id="txt_GoodsName" class="editTextbox" style="width:120px;" type="text" /></td>
<td class="f1" style="width:10%; ">
日期:</td>
<td width="25%">
<input id="txt_SDate" onfocus="WdatePicker()" class="editTextbox" style="width:80px;" type="text" />--<input id="txt_EDate" class="editTextbox" style="width:80px;" onfocus="WdatePicker()" type="text" /></td>
<td><input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" />
</td>
</tr>
<tr>
<td valign="top" colspan="5">
<input id="btn_Cancel0" class="btnClass btnClassDel" type="button" value="批量删除" onclick="DeleteYaJia();" />
</td>
</tr>
<tr>
<td valign="top" colspan="5">
<div id="DataGrid1" class="DataGridStyle"></div>
</td>
</tr>
</table>
</form>
</body>
</html>