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.

440 lines
17 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_PersonBuyList.aspx.cs" Inherits="TradeManageNew.Huowu.HW_PersonBuyList" %>
<!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();
var UserId = "<%=Session["UserId"]%>";
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
var sid = $.url.param("sid");
if (sid == undefined) {
sid = 0;
}
if (sid > 0) {
$("#select_store").val(sid);
$("#select_state").val(3);
}
else if (sid ==-1) {
$("#select_state").val(3);
}
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_PersonBuyAdd.aspx?OutId=" + model.OutId;
});
$("#" + datagrid1.TableID + " [CommandName='cmdDel']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
if (model.IsDelete == 4) {
alert("The order has been shipped and cannot be deleted");
return;
}
Delobj(model.OutId);
});
$("#btn_sch,#chk_pp").bind("click", function () {
ReadData();
});
$("#btn_add").bind("click", function () {
window.location.href = "HW_PersonBuyAdd.aspx?OutId=0";
});
});
function GetNMOrderTJ() {
//$("#div_yy").append('<input type="checkbox" yy="订单发货" />订单发货');
var param = new Object();
$.ajax({
url: "../HuoWuServiceNew.asmx/GetNMOrderTJ",
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
if (data.d != null) {
$("#div_tj").html("总销售额:"+data.d.Num4+"$ 西仓:"+data.d.Num5+"$ 东仓:"+data.d.Num6+"$ 未发货金额:"+data.d.Num7+"$ 已发货金额:"+data.d.Num19+"$" );
}
}
});
}
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 = "StoreName";
col.CellTemplate = "<a>{Bind StoreName}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "PayType";
col.CellTemplate = "<span>{Bind PayType}</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 = "200px";
col.CellTemplate = "<input CommandName='cmdLook' class='btnClass dgbtnEdit' type='button' value='View'></input>&nbsp;&nbsp;<input CommandName='cmdDel' class='btnClass dgbtnDel' type='button' value='CancelOrder'></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(id) {
if (window.confirm('Are you sure to cancel the order') == false) return;
var param = new Object();
param.outid=id;
if (id > 0) {
$.ajax({
url: "../HuoWuServiceNew.asmx/NM_DeleteOrder",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
alert("Cancel succeeded");
ReadData();
}
});
}
}
//#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.StoreId = $("#select_store").val();
param.State = $("#select_state").val();
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.PayType = $("#select_paytype").val();
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_GoodsOutListBuyNM",
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();
if (UserId == 1)
GetNMOrderTJ();
}
});
}
function ExportData() {
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.StoreId = $("#select_store").val();
param.State = $("#select_state").val();
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.PayType = $("#select_paytype").val();
param.IsDetail = 0;
if ($("#chk_pp").is(":checked") == true)
param.IsDetail = 1;
param.PageSize = 10000;
param.PageIndex =1;
param.Sort = "OutId desc";
var fname ="销售报表.xls";
$.ajax({
url: "../HuoWuServiceNew.asmx/GetListHW_GoodsOutListBuyExcel",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
params = { FilePath: data.d, FileName: fname };
window.location = "../GlobalAshx/DownFile.ashx?" + jQuery.param(params);
}
});
}
</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%">
Warehouse:</td>
<td width="15%">
<select id="select_store" class="selectClass" style="width: 120px" name="D3">
<option value="-1">All</option>
<option value="6">RANCHO(West)</option>
<option value="11">E仓East)</option>
<option value="9">JD</option>
</select></td>
<td class="f1" style="width:10%;">
Shipment status:</td>
<td width="15%">
<select id="select_state" class="selectClass" style="width: 150px" name="D4">
<option value="-1">All</option>
<option value="3">Unshipped</option>
<option value="4">Shipped</option>
</select></td> <td class="f1" width="13%">
PayType:</td>
<td width="15%">
<select id="select_paytype" class="selectClass" style="width: 120px" name="D3">
<option value="-1">All</option>
<option value="CASH">CASH</option>
<option value="card">card</option>
</select></td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="f1" style="width:10%;">
<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%">
<%-- <select id="select_lx" class="selectClass" style="width: 95px" name="D1">
<option value="0">全部</option>
<option value="1">订单发货出库</option>
<option value="2">手工出库</option>
</select>--%>
<input id="txt_code" class="editTextbox" style="width:120px;" type="text" /></td>
<td class="f1" style="width:10%; ">
Order 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 class="f1" width="13%">
</td>
<td width="15%">
</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" />&nbsp;&nbsp; <input id="btn_add0" class="btnClass btnClassExcelTemplate" type="button" onclick="ExportData();" value="Excel" />
<div style="color:red;font-size:11pt" id="div_tj"></div>
</td>
</tr>
<tr>
<td valign="top" colspan="7">
<div id="DataGrid1" class="DataGridStyle"></div>
</td>
</tr>
</table>
</form>
</body>
</html>