|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report41.aspx.cs" Inherits="TradeManageNew.TongJi.Report41" %>
|
|
|
|
|
|
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
<head id="Head1">
|
|
|
<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/jquery.min.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/MicrosoftAjax.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.url.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/WindowLoad.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
|
|
|
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
|
|
|
<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 type="text/javascript" src="../Scripts/highcharts.js"></script>
|
|
|
<script type="text/javascript" src="../Scripts/exporting.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
var sname = '';
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
WindowLoadModel.Load();
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
CreateDataGrid();
|
|
|
sname = $.url.param("SName");
|
|
|
if (sname == undefined) {
|
|
|
sname = "";
|
|
|
}
|
|
|
var dd = new Date();
|
|
|
|
|
|
var SDate = $.url.param("SDate");
|
|
|
if (SDate == undefined) {
|
|
|
SDate = "";
|
|
|
}
|
|
|
if (SDate != "") {
|
|
|
$("#txt_SDate").val(SDate);
|
|
|
$("#txt_EDate").val(SDate);
|
|
|
}
|
|
|
else {
|
|
|
$("#txt_SDate").val(dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate());
|
|
|
$("#txt_EDate").val(dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate());
|
|
|
}
|
|
|
//
|
|
|
// GetDepartMent();
|
|
|
// GetMoneyCode();
|
|
|
$("#btn_sch").bind("click", function () {
|
|
|
|
|
|
ReadData();
|
|
|
|
|
|
});
|
|
|
$("#select_sort,#select_sort1").bind("change", function () {
|
|
|
|
|
|
ReadData();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
GetBasePlat();
|
|
|
GetShopList();
|
|
|
$("#select_dept,#select_plat").bind("change", function () {
|
|
|
GetShopList();
|
|
|
});
|
|
|
ReadData();
|
|
|
$("td[rname='店铺名']").live("click", function () {
|
|
|
var sname = $(this).html();
|
|
|
window.open("../DingDan/DD_OrderListForTM2.aspx?SName=" + sname + "&SDate=" + $("#txt_SDate").val());
|
|
|
|
|
|
});
|
|
|
$("#" + datagrid1.TableID + " a[CommandName='cmdLook']").live("click", function () {
|
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
|
|
|
window.open("../DingDan/DD_OrderListForTM2.aspx?SId=" + $("#select_shop").val() + "&Name=" + model.Name + "&SDate2=" + $("#txt_SDate").val() + "&EDate2=" + $("#txt_EDate").val() + "");
|
|
|
|
|
|
});
|
|
|
});
|
|
|
|
|
|
function GetMoneyCode() {
|
|
|
$("#select_money").append("<option value='0'>全部</option>");
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../SysManage/SysManageService.asmx/GetMoneyList",
|
|
|
//data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
if (data.d != null) {
|
|
|
$(data.d).each(function () {
|
|
|
$("#select_money").append("<option value='" + this.MCode + "'>" + this.MName + "</option>");
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function GetDepartMent() {
|
|
|
$("#select_dept").append("<option value='0'>全部</option>");
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
|
param.DeptType = "事业部";
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../SysManage/SysManageService.asmx/GetDepartList",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
if (data.d != null) {
|
|
|
$(data.d).each(function () {
|
|
|
$("#select_dept").append("<option value='" + this.DeptId + "'>" + this.DeptName + "</option>");
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function fopen() {
|
|
|
|
|
|
$.fancybox({
|
|
|
'width': '40%',
|
|
|
'height': '40%',
|
|
|
'autoScale': false,
|
|
|
'transitionIn': 'elastic',
|
|
|
'transitionOut': 'elastic',
|
|
|
'href': '#test',
|
|
|
'onComplete': function () {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function GetBasePlat() {
|
|
|
$("#select_plat").empty();
|
|
|
$("#select_plat").append("<option value='0'>全部</option>");
|
|
|
var param = new Object();
|
|
|
param.CompanyID = 0;
|
|
|
param.KeyName = "ptlx";
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../UserService.asmx/GetPlatBaseCode",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
if (data.d != null) {
|
|
|
$(data.d).each(function () {
|
|
|
$("#select_plat").append("<option value='" + this.SortNo + "'>" + this.Name + "</option>");
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function GetShopList() {
|
|
|
$("#select_shop").empty();
|
|
|
$("#select_shop").append("<option value='0'>全部</option>");
|
|
|
var param = new Object();
|
|
|
param.DeptId = $("#select_dept").val();
|
|
|
param.PlatType = $("#select_plat").val();
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../BaseData.asmx/GetShopList",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
if (data.d != null) {
|
|
|
$(data.d).each(function (i) {
|
|
|
if (sname != "" && sname == this.ShopName)
|
|
|
$("#select_shop").append("<option value='" + this.ShopId + "' selected='selected'>" + this.ShopName + "</option>");
|
|
|
else
|
|
|
$("#select_shop").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function CreateDataGrid() {
|
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "店铺";
|
|
|
col.CellTemplate = "<a style='color:blue' CommandName='cmdLook'>{Bind ShopName}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "人员";
|
|
|
col.CellTemplate = "<a>{Bind Name}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "分配货号数";
|
|
|
col.CellTemplate = "<a>{Bind GNum}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "销售额(RMB)";
|
|
|
col.CellTemplate = "<a>{Bind TotalRMBPrice}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "销售额(USD)";
|
|
|
col.CellTemplate = "<a>{Bind TotalPrice}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "销售数量";
|
|
|
col.CellTemplate = "<a>{Bind GoodsNum}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "货物成本";
|
|
|
col.CellTemplate = "<a>{Bind GoodsFee}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "营业额/货物成本";
|
|
|
col.CellTemplate = "<a>{Bind PGRate}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "预估利润";
|
|
|
col.CellTemplate = "<a>{Bind LR}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
datagrid1.IsFixHeader = false;
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "分摊仓储费";
|
|
|
col.CellTemplate = "<a>{Bind ftkcfee}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
datagrid1.IsFixHeader = false;
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "面单费";
|
|
|
col.CellTemplate = "<a>{Bind mdfee}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "预估利润2";
|
|
|
col.CellTemplate = "<a>{Bind LR2}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
datagrid1.IsFixHeader = false;
|
|
|
//datagrid1.Height = "400px";
|
|
|
datagrid1.ShowIndexColumn = false;
|
|
|
datagrid1.AllowPaging = false;
|
|
|
//datagrid1.Width = "100%";
|
|
|
datagrid1.SelectMode = nblf.ui.SelectMode.None;
|
|
|
datagrid1.Init();
|
|
|
|
|
|
|
|
|
}
|
|
|
function ReadData() {
|
|
|
if ($("#txt_SDate").val() == "") {
|
|
|
alert("请输入日期范围");
|
|
|
return;
|
|
|
}
|
|
|
if ($("#txt_EDate").val() == "") {
|
|
|
alert("请输入日期范围");
|
|
|
return;
|
|
|
}
|
|
|
var param = new Object();
|
|
|
param.Name = $("#txt_Name").val();
|
|
|
|
|
|
param.ShopId = $("#select_shop").val();
|
|
|
param.PlatId = $("#select_plat").val();
|
|
|
|
|
|
|
|
|
param.InDate = $("#txt_SDate").val();
|
|
|
param.EDate = $("#txt_EDate").val();
|
|
|
param.Sort = ""; // $("#select_sort").val() + " " + $("#select_sort1").val();
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../SysManageServiceNew.asmx/GetReportTable41",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
//async: false,
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
datagrid1.DataBind(data.d);
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
function HB() {
|
|
|
$("#tb1 tr").each(function (i) {
|
|
|
if (i == 1)
|
|
|
$(this).find("td[rowindex=1]").attr("rowspan", "2");
|
|
|
else if (i == 2)
|
|
|
$(this).find("td[rowindex=1]").hide();
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function ExportData() {
|
|
|
if ($("#txt_SDate").val() == "") {
|
|
|
alert("请输入日期范围");
|
|
|
return;
|
|
|
}
|
|
|
if ($("#txt_EDate").val() == "") {
|
|
|
alert("请输入日期范围");
|
|
|
return;
|
|
|
}
|
|
|
var param = new Object();
|
|
|
param.Name = $("#txt_Name").val();
|
|
|
|
|
|
param.ShopId = $("#select_shop").val();
|
|
|
param.PlatId = $("#select_plat").val();
|
|
|
|
|
|
|
|
|
param.InDate = $("#txt_SDate").val();
|
|
|
param.EDate = $("#txt_EDate").val();
|
|
|
param.Sort = ""; // $("#select_sort").val() + " " + $("#select_sort1").val();
|
|
|
var fname = "报表.xls";
|
|
|
$.ajax({
|
|
|
url: "../SysManageServiceNew.asmx/GetReportExcel41",
|
|
|
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">
|
|
|
|
|
|
<div class="title_ico">
|
|
|
报表
|
|
|
</div>
|
|
|
|
|
|
<table border="1" cellpadding="0" cellspacing="0" style="width: 99%;" align="center" class="tableAll">
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td class="f1" width="13%" >平台/店铺:</td>
|
|
|
<td width="18%">
|
|
|
<select id="select_plat" class="selectClass" style="width: 120px" name="D3">
|
|
|
</select><select id="select_shop" class="selectClass" style="width: 120px" name="D4">
|
|
|
</select></td>
|
|
|
<td class="f1" width="13%">日期:</td>
|
|
|
<td width="35%">
|
|
|
<input id="txt_SDate" class="editTextbox" onfocus="WdatePicker()" style="width: 100px;" type="text" />-<input
|
|
|
id="txt_EDate" class="editTextbox" onfocus="WdatePicker()"
|
|
|
style="width: 100px;" type="text" /></td>
|
|
|
<td>
|
|
|
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" />
|
|
|
<input id="cmdOut" class="btnClass btnClassExcelTemplate" onclick="ExportData();" type="button" value="导出报表" /></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td class="f1" width="13%" > </td>
|
|
|
<td width="28%">
|
|
|
</td>
|
|
|
<td class="f1" width="13%">人员:</td>
|
|
|
<td width="18%">
|
|
|
<input id="txt_Name" class="editTextbox"
|
|
|
style="width: 100px;" type="text" /></td>
|
|
|
<td>
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td valign="top" colspan="5">
|
|
|
<div id="DataGrid1">
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</body>
|
|
|
</html>
|
|
|
|