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.

544 lines
20 KiB
Plaintext

2 months ago
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report12.aspx.cs" Inherits="TradeManage.TongJi.Report12" %>
<!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>
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
<script type="text/javascript" src="../Scripts/highcharts.js"></script>
<script type="text/javascript">
var WindowLoadModel = new WindowLoad();
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
GetMoneyCode();
//ReadData();
// GetDepartMent();
// GetMoneyCode();
GetYear();
$("#btn_sch").bind("click", function () {
GetChart();
});
$("#rad_2").bind("click", function () {
$("#div1").show();
$("#div2").hide();
});
$("#rad_1").bind("click", function () {
$("#div2").show();
$("#div1").hide();
});
$("input[tjnr]").bind("click", function () {
tjnr = $(this).attr("tjnr");
});
var dd = new Date();
$("#txt_SDate,#txt_EDate").val(dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate());
GetBasePlat();
GetShopList();
$("#select_plat").bind("change", function () {
GetShopList();
});
});
function GetMoneyCode() {
$.ajax({
url: "../SysManageServiceNew.asmx/GetCountSum",
//data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
}
});
}
function GetYear() {
var dd=new Date();
for (var i = 2016; i <2030; i++) {
if (i == dd.getFullYear())
$("#select_syear,#select_eyear").append("<option value='0" + i + "' selected='selected'>" + i.toString() + "</option>");
else
$("#select_syear,#select_eyear").append("<option value='0" + i + "'>" + i.toString() + "</option>");
}
for (var i = 1; i <13; i++) {
if (i < 10) {
$("#select_smon,#select_emon").append("<option value='0" + i + "'>0" + i.toString() + "月</option>");
}
else {
$("#select_smon,#select_emon").append("<option value='" + i + "'>" + i.toString() + "月</option>");
}
}
}
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>");
});
}
}
});
}
var shopids = "";
function GetShopList() {
$("#select_shop").empty();
$("#select_shop").append("<option value='0'>全部</option>");
var param = new Object();
param.CompanyId =1;
param.PlatType = $("#select_plat").val();
WindowLoadModel.Show();
var clist = new Array();
$.ajax({
url: "../BaseDataNew.asmx/GetShopAllListNew",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null) {
$(data.d).each(function (i) {
var cmd = new Object();
cmd.id = this.ShopId;
if (this.Master != null&&this.Master!="")
cmd.text = this.ShopName+ "(" + this.Master + ")";
else
cmd.text = this.ShopName;
Array.add(clist, cmd);
if (this.Master != null&&this.Master!="")
$("#select_shop").append("<option value='" + this.ShopId + "'>" + this.ShopName + "(" + this.Master + ")</option>");
else
$("#select_shop").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
});
}
}
});
$('#ddlLine').combotree({
valueField: "id", //Value字段
textField: "text", //Text字段
multiple: true,
data: [{ "id": -1, "text": "全选", "children": clist}],
// url: "tree_data2.json", //数据源
onCheck: function (node, checked) {
//让全选不显示
$("#ddlLine").combotree("setText", $("#ddlLine").combobox("getText").toString().replace("全选,", ""));
shopids=$("#ddlLine").combobox("getValues").toString();
},
onClick: function (node, checked) {
//让全选不显示
$("#ddlLine").combotree("setText", $("#ddlLine").combobox("getText").toString().replace("全选,", ""));
shopids=$("#ddlLine").combobox("getValues").toString();
}
});
}
// function ReadData() {
// 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.SDate = $("#txt_SDate").val();
// param.EDate = $("#txt_EDate").val();
// param.Sort = $("#select_sort").val() + " " + $("#select_sort1").val();
// WindowLoadModel.Show();
// $.ajax({
// url: "TJ_CountServer.asmx/GetReportTable16",
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
// //async: false,
// success: function (data) {
// WindowLoadModel.Hide();
// if (data.d != null && data.d != "") {
// $("#tb1").html(data.d);
// // HB();
// }
// }
// });
// }
function GetChart() {
if ($("#rad_1").is(":checked") == true) {
if ($("#txt_SDate").val() == "") {
alert("请输入开始日期");
return;
}
if ($("#txt_EDate").val() == "") {
alert("请输入结束日期");
return;
}
}
if (shopids == "")
shopids = "-1";
var param = new Object();
param.Type = 1;
if ($("#rad_2").is(":checked") == true)
param.Type = 2;
param.PlatId = $("#select_plat").val();
param.ShopIds = shopids;
// SYear, int SMonth, int EYear, int EMonth
param.SYear = $("#select_syear").val();
param.SMonth = $("#select_smon").val();
param.EYear = $("#select_eyear").val();
param.EMonth = $("#select_emon").val();
param.SDate = $("#txt_SDate").val();
param.EDate = $("#txt_EDate").val();
param.TJ1 = 0;
param.TJ2 = 0;
param.TJ3 =0;
param.TJ4 = 0;
param.TJ5 = 0;
param.TJ6 = 0;
param.TJ7 = 0;
param.TJ8 = 0;
param.TJ9 = 0;
param.TJ10 = 0;
if ($("#chk_1").is(":checked") == true)
param.TJ1 = 1;
if ($("#chk_2").is(":checked") == true)
param.TJ2 =1;
if ($("#chk_3").is(":checked") == true)
param.TJ3 = 1;
if ($("#chk_4").is(":checked") == true)
param.TJ4 = 1;
if ($("#chk_5").is(":checked") == true)
param.TJ5 = 1;
if ($("#chk_6").is(":checked") == true)
param.TJ6 = 1;
if ($("#chk_7").is(":checked") == true)
param.TJ7 = 1;
if ($("#chk_8").is(":checked") == true)
param.TJ8 = 1;
if ($("#chk_9").is(":checked") == true)
param.TJ9 = 1;
if ($("#chk_10").is(":checked") == true)
param.TJ10 = 1;
WindowLoadModel.Show();
var url = "../SysManageServiceNew.asmx/GetOrderCountReportNew1";
if ($("#rad_2").is(":checked") == true)
url = "../SysManageServiceNew.asmx/GetOrderCountReportNew2";
$.ajax({
url: url,
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
//async: false,
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null) {
cate = data.d.categories;
datas = data.d.Data;
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 tjnr = '总销售额';
function SetChart() {
$('#container').highcharts({
title: {
text: '订单统计报表',
x: -20 //center
},
subtitle: {
text: tjnr,
x: -20
},
xAxis: {
categories: cate
},
yAxis: {
minPadding: 0,
startOnTick: false,
title: {
text: '金额'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '$'
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: getData()
});
}
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.SDate = $("#txt_SDate").val();
param.EDate = $("#txt_EDate").val();
var fname = "报表.xls";
$.ajax({
url: "TJ_CountServer.asmx/GetReportExcel16",
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="25%">
<input id="rad_1" checked="true" name="tj" type="radio" />按天统计 <input id="rad_2" name="tj" type="radio" />按月统计</td>
<td class="f1" width="13%"><span id="sp_1"></span></td>
<td width="35%">
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="f1" width="13%" >平台/店铺:</td>
<td width="25%">
<select id="select_plat" class="selectClass" style="width: 120px" name="D3">
</select><select id="select_shop" class="selectClass" style="width: 120px;display:none" name="D4">
</select><select id="ddlLine" class="easyui-combotree" style="width: 205px; height: 24px;">
</select></td>
<td class="f1" width="13%">日期:</td>
<td width="35%"><div id="div1" style="display:none"><select id="select_syear" class="selectClass" style="width: 60px" name="D3">
</select><select id="select_smon" class="selectClass" style="width: 60px" name="D4">
</select>--<select id="select_eyear" class="selectClass" style="width: 60px" name="D3">
</select><select id="select_emon" class="selectClass" style="width: 60px" name="D4">
</select></div><div id="div2">
<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" /></div></td>
<td>
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" />&nbsp;
</td>
</tr>
<tr>
<td class="f1" width="13%" >统计项:</td>
<td colspan="4"> <input id="chk_10" type="radio" name="tjx" checked="checked" tjnr="总销售额" />总销售额
<input id="chk_1" type="radio" name="tjx" tjnr="总销售额" />总销售额扣除佣金 <input id="chk_2" type="radio" name="tjx" tjnr="参与预估利润计算的销售额" />参与预估利润计算的销售额<input
id="chk_3" type="radio" name="tjx" tjnr="参与实际利润计算的销售额" />参与实际利润计算的销售额 <input id="chk_8" type="radio" name="tjx" tjnr="预估利润" />预估利润 <input id="chk_9" type="radio" name="tjx" tjnr="实际利润" />实际利润 <input id="chk_4" type="radio" name="tjx" tjnr="预估货物成本" />预估货物成本<input id="chk_5" type="radio" name="tjx" tjnr="实际货物成本" />实际货物成本 <input id="chk_6" type="radio" name="tjx" tjnr="预估运费" />预估运费<input id="chk_7" type="radio" name="tjx" tjnr="实际运费" />实际运费 </td>
</tr>
<tr>
<td class="f1" width="13%" >&nbsp;</td>
<td colspan="4">
<font color='red'>销售额已经扣除佣金,预估货物成本和实际货物成本已包含头程费,退货赔款订单暂时没处理</font> </td>
</tr>
<tr>
<td valign="top" colspan="5">
<div id="container" style="height:400px;width:95%">
</div>
</td>
</tr>
</table>
</body>
</html>