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.
469 lines
16 KiB
Plaintext
469 lines
16 KiB
Plaintext
2 months ago
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HW_ProductCompareCount.aspx.cs" Inherits="TradeManage.HuoWu.HW_ProductCompareCount" %>
|
||
|
|
||
|
|
||
|
<!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 type="text/javascript" src="../Scripts/highcharts.js"></script>
|
||
|
|
||
|
<script type="text/javascript" src="../Scripts/exporting.js"></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>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
var CompareId = 0;
|
||
|
var WindowLoadModel = new WindowLoad();
|
||
|
$(document).ready(function () {
|
||
|
WindowLoadModel.ApplicationPath = "../";
|
||
|
WindowLoadModel.ControlID = "WindowLoad";
|
||
|
WindowLoadModel.Isbgiframe = true;
|
||
|
WindowLoadModel.Load();
|
||
|
ajaxInit(WindowLoadModel);
|
||
|
CompareId = $.url.param("Id");
|
||
|
if (CompareId == undefined) {
|
||
|
CompareId = 0;
|
||
|
}
|
||
|
//$("#txt_SDate").val("2015-07-01");
|
||
|
//$("#txt_EDate").val("2015-07-30");
|
||
|
$("#div1").empty();
|
||
|
GetProductDetail();
|
||
|
$("#btn_sch").bind("click", function () {
|
||
|
GetProductData();
|
||
|
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
$("#chk_all").live("click", function () {
|
||
|
if ($(this).is(":checked") == true)
|
||
|
$("#div_product input").attr("checked", "checked");
|
||
|
else
|
||
|
$("#div_product input").removeAttr("checked");
|
||
|
|
||
|
|
||
|
});
|
||
|
$("#select_chart").bind("change",function () {
|
||
|
GetProductCountChart();
|
||
|
|
||
|
});
|
||
|
});
|
||
|
|
||
|
function GetProductData() {
|
||
|
var list = new Array();
|
||
|
$("#div_product input[no]:checked").each(function () {
|
||
|
var md = new Object();
|
||
|
md.Id = $(this).attr("no");
|
||
|
md.ProductDesc = $(this).next("span").html();
|
||
|
md.ProductId = $(this).attr("pid");
|
||
|
Array.add(list, md);
|
||
|
});
|
||
|
if (list.length <= 0) {
|
||
|
alert("请选择要比较分析的产品");
|
||
|
return;
|
||
|
}
|
||
|
if ($("#txt_SDate").val() == "" || $("#txt_EDate").val() == "") {
|
||
|
alert("请填写要分析的日期范围");
|
||
|
return;
|
||
|
}
|
||
|
var param = new Object();
|
||
|
param.list = list;
|
||
|
WindowLoadModel.Show();
|
||
|
$.ajax({
|
||
|
url: "HuoWuService.asmx/GetProductData",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
|
||
|
if (data.d != null) {
|
||
|
|
||
|
|
||
|
GetProductCount();
|
||
|
|
||
|
}
|
||
|
WindowLoadModel.Hide();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
function GetProductDetail() {
|
||
|
var param = new Object();
|
||
|
param.CompareId = CompareId;
|
||
|
WindowLoadModel.Show();
|
||
|
$.ajax({
|
||
|
url: "HuoWuService.asmx/GetCompareDetailList",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
success: function (data) {
|
||
|
WindowLoadModel.Hide();
|
||
|
if (data.d != null) {
|
||
|
|
||
|
$("#div_product").append("<input type='checkbox' id='chk_all' />全选<br/>");
|
||
|
$(data.d).each(function () {
|
||
|
|
||
|
$("#div_product").append("<input type='checkbox' no='" + this.Id + "' pid='" + this.ProductId + "'/><span>" + this.ProductDesc + "[" + this.ProductId + "]</span>");
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
var itemlist = new Array();
|
||
|
function GetOrderCountItem() {
|
||
|
var param = new Object();
|
||
|
param.PlatType = $("#select_plat").val();
|
||
|
param.SDate = $("#txt_SDate").val();
|
||
|
param.EDate = $("#txt_EDate").val();
|
||
|
|
||
|
$.ajax({
|
||
|
url: "TJ_CountServer.asmx/GetOrderCountItem",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
dataType: "json",
|
||
|
async: false,
|
||
|
success: function (data) {
|
||
|
if (data.d != null) {
|
||
|
itemlist = data.d;
|
||
|
CreateDataGrid();
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
}
|
||
|
var cate = new Array();
|
||
|
var datas = "";
|
||
|
var arr1 = new Array();
|
||
|
function GetProductCount() {
|
||
|
var param = new Object();
|
||
|
var list = new Array();
|
||
|
$("#div_product input[no]:checked").each(function () {
|
||
|
var md = new Object();
|
||
|
md.Id = $(this).attr("no");
|
||
|
md.ProductDesc = $(this).next("span").html();
|
||
|
Array.add(list, md);
|
||
|
});
|
||
|
if (list.length <= 0) {
|
||
|
alert("请选择要比较分析的产品");
|
||
|
return;
|
||
|
}
|
||
|
if ($("#txt_SDate").val() == "" || $("#txt_EDate").val() == "") {
|
||
|
alert("请填写要分析的日期范围");
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
param.list = list;
|
||
|
param.SDate = $("#txt_SDate").val();
|
||
|
param.EDate = $("#txt_EDate").val();
|
||
|
$.ajax({
|
||
|
url: "HuoWuService.asmx/GetProductCount",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
dataType: "json",
|
||
|
async: true,
|
||
|
success: function (data) {
|
||
|
if (data.d != null) {
|
||
|
if (data.d == "-1")
|
||
|
{
|
||
|
alert("结束日期不能答应开始日期");
|
||
|
return;
|
||
|
}
|
||
|
else if (data.d == "-2")
|
||
|
{
|
||
|
alert("日期范围不能超过1个月");
|
||
|
return;
|
||
|
|
||
|
}
|
||
|
$("#div1").html(data.d);
|
||
|
GetProductCountChart();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
}
|
||
|
var DgData = new Array();
|
||
|
function GetProductCountChart() {
|
||
|
var param = new Object();
|
||
|
var list = new Array();
|
||
|
$("#div_product input[no]:checked").each(function () {
|
||
|
var md = new Object();
|
||
|
md.Id = $(this).attr("no");
|
||
|
md.ProductDesc = $(this).next("span").html();
|
||
|
Array.add(list, md);
|
||
|
});
|
||
|
if (list.length <= 0) {
|
||
|
alert("请选择要比较分析的产品");
|
||
|
return;
|
||
|
}
|
||
|
if ($("#txt_SDate").val() == "" || $("#txt_EDate").val() == "") {
|
||
|
alert("请填写要分析的日期范围");
|
||
|
return;
|
||
|
}
|
||
|
param.list = list;
|
||
|
param.SDate = $("#txt_SDate").val();
|
||
|
param.EDate = $("#txt_EDate").val();
|
||
|
param.ChartType = $("#select_chart").val();
|
||
|
$.ajax({
|
||
|
url: "HuoWuService.asmx/GetProductCountChart",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
dataType: "json",
|
||
|
async: false,
|
||
|
success: function (data) {
|
||
|
if (data.d != null) {
|
||
|
|
||
|
cate = data.d.categories;
|
||
|
if ($("#select_chart").val() == "1")
|
||
|
Unit = "(件)";
|
||
|
else
|
||
|
Unit = "(美元)";
|
||
|
datas = data.d.Data;
|
||
|
subTitle = $("#txt_SDate").val() + "--" + $("#txt_EDate").val();
|
||
|
//DgData = data.d.listData;
|
||
|
|
||
|
SetChart();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
}
|
||
|
function getData() {
|
||
|
|
||
|
//var data = "[{name: '速卖通',data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]}, {name: '亚马逊',data: [5, 5.5, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5]}, {name: 'EBay',data: [3, 3, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0]}, {name: 'Wish',data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]}]";
|
||
|
var dataJsonobj = eval("(" + datas + ")");//转换成json对象
|
||
|
|
||
|
return dataJsonobj;
|
||
|
|
||
|
}
|
||
|
var Title = "产品对比数据分析";
|
||
|
var subTitle = "2015年04月15日--2015年04月20日";
|
||
|
var secondTitle = "产品数据比较";
|
||
|
var Unit = "(件)";
|
||
|
function SetChart() {
|
||
|
|
||
|
$('#container').highcharts({
|
||
|
title: {
|
||
|
text: Title,
|
||
|
x: -20 //center
|
||
|
},
|
||
|
subtitle: {
|
||
|
text: subTitle,
|
||
|
x: -20
|
||
|
},
|
||
|
xAxis: {
|
||
|
categories: cate
|
||
|
},
|
||
|
yAxis: {
|
||
|
minPadding: 0,
|
||
|
startOnTick: false,
|
||
|
title: {
|
||
|
text: secondTitle
|
||
|
},
|
||
|
plotLines: [{
|
||
|
value: 0,
|
||
|
width: 1,
|
||
|
color: '#808080'
|
||
|
}]
|
||
|
},
|
||
|
tooltip: {
|
||
|
valueSuffix: Unit
|
||
|
},
|
||
|
legend: {
|
||
|
layout: 'vertical',
|
||
|
align: 'right',
|
||
|
verticalAlign: 'middle',
|
||
|
borderWidth: 0
|
||
|
},
|
||
|
series: getData()
|
||
|
});
|
||
|
|
||
|
}
|
||
|
function CreateDataGrid() {
|
||
|
Array.clear(datagrid1.Columns);
|
||
|
var col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "店铺平台";
|
||
|
col.CellTemplate = "<a>{Bind ShopName}</a>";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
$(itemlist).each(function () {
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = this.name;
|
||
|
col.CellTemplate = "<span>{Bind " + this.dataname + "}</span>";
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
datagrid1.IsFixHeader = false;
|
||
|
datagrid1.ShowIndexColumn = false;
|
||
|
datagrid1.AllowPaging = false;
|
||
|
datagrid1.Width = "100%";
|
||
|
datagrid1.SelectMode = nblf.ui.SelectMode.None;
|
||
|
datagrid1.Init();
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
</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 colspan="3">
|
||
|
<div id="div_date">
|
||
|
<input id="txt_SDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" />-
|
||
|
<input id="txt_EDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" />
|
||
|
</div>
|
||
|
</td>
|
||
|
<td>
|
||
|
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
|
||
|
|
||
|
</tr>
|
||
|
<tr>
|
||
|
|
||
|
<td class="f1" width="13%">选择要比较的产品:</td>
|
||
|
<td colspan="3">
|
||
|
<div id="div_product"></div>
|
||
|
</td>
|
||
|
<td> </td>
|
||
|
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top" colspan="5">
|
||
|
<div id="div1">
|
||
|
<table border="1" cellpadding="0" cellspacing="0" style="width: 99%;" align="center" class="DataGridTableStyle">
|
||
|
<tr class="HeaderStyle">
|
||
|
<th rowspan="2">日期/产品</th>
|
||
|
|
||
|
<th colspan="4">产品1</th>
|
||
|
<th colspan="4">产品2</th>
|
||
|
</tr>
|
||
|
<tr class="HeaderStyle">
|
||
|
<th>销量</th>
|
||
|
<th>均价</th>
|
||
|
<th>最高价</th>
|
||
|
<th>最低价</th>
|
||
|
<th>销量</th>
|
||
|
<th>均价</th>
|
||
|
<th>最高价</th>
|
||
|
<th>最低价</th>
|
||
|
</tr>
|
||
|
<tr class="DataGridRowStyle">
|
||
|
<td>2015-07-24</td>
|
||
|
<td>16</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>18</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td></tr>
|
||
|
<tr class="DataGridRowStyle">
|
||
|
<td>2015-07-24</td>
|
||
|
<td>16</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>18</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td></tr>
|
||
|
<tr class="DataGridRowStyle">
|
||
|
<td>2015-07-24</td>
|
||
|
<td>16</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>18</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td></tr>
|
||
|
<tr class="DataGridRowStyle">
|
||
|
<td>2015-07-24</td>
|
||
|
<td>16</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>18</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td>
|
||
|
<td>$12.5</td></tr>
|
||
|
</table>
|
||
|
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr style="display:none">
|
||
|
|
||
|
<td colspan="5">
|
||
|
<select id="select_chart" class="selectClass" style="width:120px" name="D1">
|
||
|
<option value="1">显示销量对比图</option>
|
||
|
<option value="2">显示均价对比图</option>
|
||
|
<option value="3">显示最高价对比图</option>
|
||
|
<option value="4">显示最低价对比图</option>
|
||
|
</select>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
|
||
|
<td colspan="5">
|
||
|
<div id="container">
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
</table>
|
||
|
|
||
|
</body>
|
||
|
</html>
|
||
|
|
||
|
|
||
|
|
||
|
|