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.

315 lines
12 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HW_BuyOutList.aspx.cs" Inherits="TradeManageNew.Huowu.HW_BuyOutList" %>
<!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_BuyOut2.aspx?OutId=" + model.OutId;
});
$("#btn_sch,#chk_pp").bind("click", function () {
ReadData();
});
$("#btn_add").bind("click", function () {
window.location.href = "HW_BuyOut2.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>Commodity list<td><td style='font-weight:normal;'>";
if (md.GoodsOutCKList2 != null) {
$(md.GoodsOutCKList2).each(function () {
shtmls += "<a style='cursor: pointer; text-decoration: underline; color: #5599FF;font-weight:normal;' onclick='LinkGoods(" + this.GoodsId + ")'>" + this.GoodsCode + " " + this.TypeDesc + "</a> &nbsp; &nbsp;<span>" + this.SKU1 + "</span> &nbsp; &nbsp;Selling Quantity</font>" + this.OutNum + "&nbsp; &nbsp;Selling Price</font>" + this.FinalPrice + "<br/>";
});
}
shtmls += "</table></td><tr>";
$(this).after(shtmls);
// $(".fancybox").fancybox();
}
});
}
//#endregion
//#region 初始化DataGrid
function CreateDataGrid() {
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "OrderCode";
col.CellTemplate = "<a CommandName='cmdLook' class='linka'>{Bind OutCode}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Operator";
col.CellTemplate = "<a>{Bind InName}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "BuyDate";
col.CellTemplate = "<span>{Bind InDate,yyyy-MM-dd HH:mm}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Purchaser Name";
col.CellTemplate = "<span>{Bind BuyName}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Purchaser Phone";
col.CellTemplate = "<span>{Bind BuyPhone}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Total Money";
col.CellTemplate = "<span>{Bind Price}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "commission";
col.CellTemplate = "<span>{Bind commission}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Status";
col.CellTemplate = "<span>{Bind State}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Operation";
col.Width = "150px";
col.CellTemplate = "<input CommandName='cmdLook' class='btnClass dgbtnEdit' type='button' value='View'></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 = "'线下销售'";
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_GoodsOutListBuy",
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();
}
});
}
</script>
</head>
<body class="headbody">
<form id="form1" runat="server">
<div class="title_ico">
Offline sales
</div>
<table id="tb1" class="tableAll" style="width:100%;" >
<tr>
<td class="f1" width="13%">
<select id="select_tj" class="selectClass" style="width: 150px" name="D2">
<option value="1">Products Code</option>
<option value="6">OrderCode</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%; ">
Buy Date</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="Query" />
</td>
</tr>
<tr>
<td colspan="7">
<input id="chk_pp" type="checkbox" checked="checked" />List item details <input id="btn_add" class="btnClass btnClassAdd" type="button" value="Add" />
</td>
</tr>
<tr>
<td valign="top" colspan="7">
<div id="DataGrid1" class="DataGridStyle"></div>
</td>
</tr>
</table>
</form>
</body>
</html>