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.

345 lines
13 KiB
Plaintext

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HW_GoodsOutListForTM.aspx.cs" Inherits="TradeManage.HuoWu.HW_GoodsOutListForTM" %>
<!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();
GetCKYY();
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_GoodsOutLook.aspx?OutId=" + model.OutId;
});
$("#btn_sch,#chk_pp").bind("click", function () {
ReadData();
});
$("#btn_add").bind("click", function () {
window.location.href = "HW_GoodsOutAddForTM.aspx?OutId=0";
});
});
function GetCKYY() {
//$("#div_yy").append('<input type="checkbox" yy="订单发货" />订单发货');
var param = new Object();
param.CompanyID = 0;
param.KeyName = "ckyy";
$.ajax({
url: "../UserService.asmx/GetListBaseCode",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
if (data.d != null) {
$(data.d).each(function () {
$("#div_yy").append('<input type="checkbox" yy="' + this.Name + '" />' + this.Name);
});
}
}
});
}
function LinkGoods(GId) {
window.parent.addTab("货物编辑", "HuoWu/HW_GoodsAddForTM.aspx?Title=订单查询&GoodsId=" + GId, true);
}
function AddTr() {
$("#" + datagrid1.TableID + " tr").each(function (i) {
if (i > 0) {
var index = $(this).attr("index");
var md = datagrid1.Get_Model(index);
var shtmls = "";
shtmls = "<tr><td colspan='5'><table width='94%' class='trTable'><tr><td>出库明细<td><td style='font-weight:normal;'>";
if (md.GoodsOutCKList != null) {
$(md.GoodsOutCKList).each(function () {
shtmls += "<a style='cursor: pointer; text-decoration: underline; color: #5599FF;font-weight:normal;' onclick='LinkGoods(" + this.GoodsId + ")'>" + this.GoodsCode + "--" + this.GoodsName + this.TypeCode + "</a> &nbsp; &nbsp;<span>" + this.TypeDesc + "</span> &nbsp; &nbsp;出库数量:</font>" + this.OutNum + "<br/>";
});
}
shtmls += "</table></td><tr>";
$(this).after(shtmls);
// $(".fancybox").fancybox();
}
});
}
//#endregion
//#region 初始化DataGrid
function CreateDataGrid() {
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "出库单号";
col.CellTemplate = "<a CommandName='cmdLook' class='linka'>{Bind OutCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "定单号";
col.CellTemplate = "<a CommandName='cmdLook' class='linka'>{Bind PlatOrderCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "出库人";
col.CellTemplate = "<a>{Bind InName}</a>";
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 OutReason}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "150px";
col.CellTemplate = "<input CommandName='cmdLook' class='btnClass dgbtnEdit' type='button' value='查看'></input>";
Array.add(datagrid1.Columns, col);
datagrid1.SetPageSize(20);
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(); });
}
function Delobj(obj) {
if (window.confirm('确定要删除吗?') == false) return;
datagrid1.UpdateDataSource();
var rowindex = $(obj).parent().parent().attr("index");
var param = new Object();
var model = datagrid1.Get_Model(rowindex);
param.OutId = model.OutId;
if (model.OutId > 0) {
$.ajax({
url: "HuoWuService.asmx/DeleteOut",
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_code").val();
param.TJ = $("#select_tj").val();
param.SDate = null;
var CKType = "";
$("input[yy]").each(function () {
if ($(this).is(":checked") == true)
CKType += "'" + $(this).attr("yy") + "',";
});
param.CKType = CKType;
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.IsDetail = 0;
if ($("#chk_pp").is(":checked") == true)
param.IsDetail = 1;
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
param.Sort = "OutId desc";
WindowLoadModel.Show();
$.ajax({
url: "../HuoWuServiceNew.asmx/GetListHW_GoodsOutListForTM",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
if (param.IsDetail == 1)
AddTr();
}
});
}
function ExportAllData() {
var param = new Object();
param.GoodsName = $("#txt_code").val();
param.TJ = $("#select_tj").val();
param.SDate = null;
var CKType = "";
$("input[yy]").each(function () {
if ($(this).is(":checked") == true)
CKType += "'" + $(this).attr("yy") + "',";
});
param.CKType = CKType;
if ($("#txt_SDate").val() != "")
param.SDate = $("#txt_SDate").val();
param.EDate = null;
if ($("#txt_EDate").val() != "")
param.EDate = $("#txt_EDate").val();
var fname = "出库列表.xls";
$.ajax({
url: "../HuoWuServiceNew.asmx/ImportListHW_GoodsOutListForTM",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
if (data.d != null && data.d.Code == 1) {
params = { FilePath: data.d.Message, FileName: fname };
window.location = "../GlobalAshx/DownFile.ashx?" + jQuery.param(params);
alert("Success");
} else {
alert(data.d.Message);
}
}
});
}
</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%">
<select id="select_tj" class="selectClass" style="width: 95px" name="D2">
<option value="1">货物编号</option>
<option value="2">货物名称</option>
<option value="3">货物SKU</option>
<option value="6">出库单号</option>
<option value="7">订单号</option>
<option value="4">库位</option>
</select></td>
<td width="15%">
<input id="txt_code" class="editTextbox" style="width:120px;" type="text" /></td>
<td class="f1" style="width:10%;">
</td>
<td width="15%">
<%-- <select id="select_lx" class="selectClass" style="width: 95px" name="D1">
<option value="0">全部</option>
<option value="1">订单发货出库</option>
<option value="2">手工出库</option>
</select>--%>
</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 class="f1" width="13%">
出库原因:</td>
<td colspan=6><div id="div_yy"></div></td>
</tr>
<tr>
<td colspan="7">
<input id="chk_pp" type="checkbox" checked="checked" />列出出库明细 <input id="btn_add" class="btnClass btnClassAdd" type="button" value="新增出库" />
<input id="btn_import" class="btnClass btnClassAdd" type="button" value="导出" onclick="ExportAllData()" />
</td>
</tr>
<tr>
<td valign="top" colspan="7">
<div id="DataGrid1" class="DataGridStyle"></div>
</td>
</tr>
</table>
</form>
</body>
</html>