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.

399 lines
15 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="Report182.aspx.cs" Inherits="TradeManageNew.TongJi.Report182" %>
<!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.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 UserId = "<%=Session["UserId"]%>";
var WindowLoadModel = new WindowLoad();
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
//
GetDepartMent();
GetMoneyCode();
$("#btn_sch").bind("click", function () {
ReadData();
});
$("#select_sort,#select_sort1").bind("change", function () {
ReadData();
});
var dd = new Date();
$("#txt_SDate,#txt_EDate").val(dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate());
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());
});
$("td[rname='订单数']").live("click", function () {
var sname = $(this).parent().find("td[rname='店铺名']").html();
window.open("Report41.aspx?SName=" + sname + "&SDate=" + $("#txt_SDate").val());
});
});
function GetMoneyCode() {
$("#select_money").append("<option value='0'>全部</option>");
// return;
$.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>");
// return;
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>");
// return;
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>");
// return;
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),
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null) {
$(data.d).each(function (i) {
$("#select_shop").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
});
}
}
});
}
function ReadData() {
if ($("#txt_SDate").val() == "") {
alert("请输入日期范围");
return;
}
if ($("#txt_EDate").val() == "") {
alert("请输入日期范围");
return;
}
var param = new Object();
param.DeptId = $("#select_dept").val();
param.ShopId = $("#select_shop").val();
param.PlatId = $("#select_plat").val();
param.MoneyCode = $("#select_money").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/GetReportTable182",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
//async: false,
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null && data.d != "") {
$("#tb1").html(data.d);
var dds=parseInt($("td[rtype='hj'][rname='订单数']").html());
var xse=parseFloat($("td[rtype='hj'][rname='营业额USD']").html());
if(dds>0)
$("td[rtype='hj'][rname='客单价USD']").html((xse/dds).toFixed(2));
$("td[rname='订单缺陷率']").each(function () {
if ($(this).html() != "") {
if (parseFloat($(this).html()) >= 0.5 && parseFloat($(this).html())<1) {
$(this).css("color","blue");
}
else
if (parseFloat($(this).html()) >=1) {
$(this).css("color", "red");
}
}
});
$("td[rname='退货满意率']").each(function () {
if ($(this).html() != "") {
if (parseFloat($(this).html()) > 90 && parseFloat($(this).html()) <=95) {
$(this).css("color", "blue");
}
else
if (parseFloat($(this).html())<=90) {
$(this).css("color", "red");
}
}
});
$("td[rname='取消率']").each(function () {
if ($(this).html() != "") {
if (parseFloat($(this).html()) >= 1.5 && parseFloat($(this).html()) < 2.5) {
$(this).css("color", "blue");
}
else
if (parseFloat($(this).html())>=2.5) {
$(this).css("color", "red");
}
}
});
$("td[rname='有效跟踪码率']").each(function () {
if ($(this).html() != "") {
if (parseFloat($(this).html()) > 95 && parseFloat($(this).html()) <=97) {
$(this).css("color", "blue");
}
else
if (parseFloat($(this).html())<=95) {
$(this).css("color", "red");
}
}
});
// HB();
}
}
});
}
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;
}
var param = new Object();
param.DeptId = $("#select_dept").val();
param.ShopId = $("#select_shop").val();
param.PlatId = $("#select_plat").val();
param.MoneyCode = $("#select_money").val();
param.Sort = $("#select_sort").val() + " " + $("#select_sort1").val();
param.InDate = $("#txt_SDate").val();
//param.EDate = $("#txt_EDate").val();
var fname ="报表.xls";
$.ajax({
url: "../SysManageServiceNew.asmx/GetReportExcel18",
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_dept" class="selectClass" style="width: 120px" name="D1">
</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="查询" />&nbsp;
<input id="cmdOut" class="btnClass btnClassExcelTemplate" onclick="ExportData();" type="button" value="导出报表" style="display:none" /></td>
</tr>
<tr>
<td class="f1" width="13%" >平台/店铺:</td>
<td width="28%">
<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="18%">
<select id="select_money" class="selectClass" style="width: 120px" name="D2">
</select></td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="f1" width="13%" >排序:</td>
<td width="28%">
<select id="select_sort" class="selectClass" style="width: 120px" name="D5">
<option value="c.OrderNum">订单量</option>
<option value="c.USDMoney">营业额(美元)</option>
<option value="c.RMBMoney">营业额(人民币)</option>
</select><select id="select_sort1" class="selectClass" style="width: 60px" name="D6">
<option value="desc">降序</option>
<option value="asc">升序</option>
</select></td>
<td class="f1" width="13%">&nbsp;</td>
<td width="18%">
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td valign="top" colspan="5">
<div style="width:100%"><table class="DataGridTableStyle" style="width:100%" id="tb1"></table></div>
</td>
</tr>
</table>
</body>
</html>