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.

297 lines
10 KiB
Plaintext

2 months ago
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HW_NoMate.aspx.cs" Inherits="TradeManage.HuoWu.HW_NoMate" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<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" />
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.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.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/fancybox/jquery.fancybox-1.3.4.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();
GetShopList();
ReadData();
$("#cmdAdd").click(function () {
$("#txtGoodsCode").val("");
ShowFancybox();
});
$("#cmdGet").click(function () {
ReadData();
});
$("#cmdSave").click(function () {
Save();
});
$("#" + datagrid1.TableID + " input[CommandName]").live("click", function () {
var index = $(this).parentsUntil("tr").parent().attr("index");
Model = datagrid1.Get_Model(index);
var ColName = $(this).attr("CommandName");
if (ColName == "cmdDel") {
Delete(Model.Id);
}
});
});
function GetShopList() {
$("#select_shop").append("<option value='0'>-选择-</option>");
var param = new Object();
param.PlatType = 0;
WindowLoadModel.Show();
$.ajax({
url: "../BaseData.asmx/GetShopListForTM",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null) {
$(data.d).each(function () {
$("#select_shop").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
});
}
}
});
}
//#endregion
//#region 初始化DataGrid
function CreateDataGrid() {
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "店铺名称";
col.CellTemplate = "<span>{Bind ShopName}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "货物编号";
col.CellTemplate = "<span>{Bind GoodsCode}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "120px";
col.CellTemplate = "<input CommandName='cmdDel' class='btnClass dgbtnDel' type='button' value='删除'></input>";
Array.add(datagrid1.Columns, col);
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.GoodsCode = $("#txt_goodscode").val();
param.ShopName = $("#txt_shopname").val();
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
param.Sort = "Id desc";
WindowLoadModel.Show();
$.ajax({
url: "HuoWuService.asmx/GetListHW_NoMate",
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 ShowFancybox() {
$.fancybox({
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'href': '#WindowAdd',
'onStart': function () {
}
});
}
//#endregion
//#region 保存
function Save() {
if ($("#select_shop").val() == "0") {
alert("请选择店铺");
return;
}
if ($("#txtGoodsCode").val() == "")
{
alert("请输入货物编号");
return;
}
var Model = new Object();
Model.Id = 0;
Model.GoodsCode = $("#txtGoodsCode").val();
Model.ShopId = $("#select_shop").val();
var param = new Object();
param.Model = Model;
WindowLoadModel.Show();
$.ajax({
url: "HuoWuService.asmx/SaveNoMate",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
if (data.d == 0)
{
alert("货物编号不存在");
return;
}
ReadData();//刷新DataGrid
alert("保存成功");
$.fancybox.close();
}
});
}
//#endregion
//#region 删除
function Delete(Id) {
if (window.confirm("确定要删除吗?") == false) return;
var param = new Object();
param.Id = Id;
WindowLoadModel.Show();
$.ajax({
url: "HuoWuService.asmx/DeleteMate",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
ReadData(); //刷新DataGrid
}
});
}
//#endregion
</script>
</head>
<body class="headbody">
<div class="title_ico">
sku不分配设置
</div>
<table id="tb1" class="tableAll" style="width: 100%;">
<colgroup>
<col style="width: 80px;" />
<col style="width: 260px;" />
<col style="width: 80px;" />
<col />
<col />
</colgroup>
<tr> <td class="f1">店铺:
</td>
<td> <input id="txt_shopname" type="text" class="editTextbox" style="width: 120px;" />
</td>
<td class="f1">编号:
</td>
<td> <input id="txt_goodscode" type="text" class="editTextbox" style="width: 120px;" />
</td>
<td>
<input id="cmdGet" type="button" class="btnClass btnClassFind" value="查询" />
</td>
</tr>
<tr>
<td colspan="5">
<input id="cmdAdd" class="btnClass btnClassAdd" 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="WindowAdd" title="编辑" style="width:350px;height:auto;">
<table id="tb2" class="tableAll" style="width: 100%;">
<colgroup>
<col style="width: 80px;" />
<col />
</colgroup>
<tr>
<td class="f1"><span style="color: Red;">*</span>店铺
</td>
<td><select id="select_shop" class="selectClass" name="D5" style="width:120px;">
</select>
</td>
</tr>
<tr>
<td class="f1">编号
</td>
<td colspan="3">
<input id="txtGoodsCode" type="text" class="editTextbox" style="width: 99%;" />
</td>
</tr>
<tr>
<td colspan="8" align="center">
<input id="cmdSave" class="btnClass btnClassSave" type="button" value="保存" />
</td>
</tr>
</table>
</div>
</div>
</body>
</html>