|
|
|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PeopleDaySaleDatasNew.aspx.cs" Inherits="TradeManageNew.TongJi.PeopleDaySaleDatasNew" %>
|
|
|
|
|
|
|
|
|
|
<!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/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/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/echarts.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 type="text/javascript">
|
|
|
|
|
|
|
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
|
|
|
var UserId = "<%=Session["UserId"]%>";
|
|
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
|
|
var Id = 0;
|
|
|
|
|
var tcUserId = 0;//点击的弹出框当前的userid
|
|
|
|
|
var tcPlatId = 0;
|
|
|
|
|
|
|
|
|
|
var pUserId = 0;//产品类目弹出框的userid和platid
|
|
|
|
|
var pPlatId = 0;
|
|
|
|
|
var pUserName = '';
|
|
|
|
|
var pIsGroup = 0;
|
|
|
|
|
var nowSpan = null;//正在修改的产品类目元素
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
|
|
WindowLoadModel.Load();
|
|
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
|
|
|
|
|
|
var day1 = new Date();
|
|
|
|
|
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
|
|
|
|
|
var s1 = day1.getFullYear() + "-" + (day1.getMonth() + 1) + "-" + day1.getDate();
|
|
|
|
|
$("#txtSDate").val(s1);
|
|
|
|
|
$("#txtEDate").val(s1);
|
|
|
|
|
|
|
|
|
|
ReadUser();
|
|
|
|
|
GetGoodSortDatas();
|
|
|
|
|
|
|
|
|
|
CreateDataGrid();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#txt_ba,#txt_ca,#txt_fn,#txt_fd").MaskedTextBox();
|
|
|
|
|
ReadData();
|
|
|
|
|
|
|
|
|
|
$("#btn_sch").bind("click", function () {
|
|
|
|
|
ReadData();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [class='chart-cell']").live("click", function () {
|
|
|
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
|
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
|
|
tcUserId = $(this).attr("userid");//获取当前行的userid
|
|
|
|
|
tcPlatId = $(this).attr("platid");
|
|
|
|
|
getZXTdate();//设置时间区间
|
|
|
|
|
$('input[name="dataType"][value="3"]').prop('checked', true);//默认选中销售额
|
|
|
|
|
$('input[name="dateType"][value="1"]').prop('checked', true);//默认选中天
|
|
|
|
|
var divElement = document.getElementById('bigZXT');
|
|
|
|
|
var myChart = echarts.init(divElement);
|
|
|
|
|
myChart.dispose();//打开之前先清除一遍折线图,避免上次缓存
|
|
|
|
|
|
|
|
|
|
fopen();//打开弹出框
|
|
|
|
|
CraeteBigZXTData();//获取折线图数据
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 监听单选框的值改变事件
|
|
|
|
|
$('input[name="dataType"]').on('change', function () {
|
|
|
|
|
CraeteBigZXTData();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 监听单选框的值改变事件
|
|
|
|
|
$('input[name="dateType"]').on('change', function () {
|
|
|
|
|
CraeteBigZXTData();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [class='adDetails']").live("click", function () {
|
|
|
|
|
tcUserId = $(this).attr("userid");//获取当前行的userid
|
|
|
|
|
getZXTdate();//设置时间区间
|
|
|
|
|
|
|
|
|
|
var url = "../TongJi/PeopleDayAdFeeDetail.aspx?userid=" + tcUserId + "&sDate=" + $("#txtSDate").val() + "&eDate=" + $("#txtEDate").val()
|
|
|
|
|
window.open(url, "_blank");
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [class='stockDetails']").live("click", function () {
|
|
|
|
|
tcUserId = $(this).attr("userid");//获取当前行的userid
|
|
|
|
|
var url = "../TongJi/PeopleStockNumPriceDetail.aspx?userid=" + tcUserId;
|
|
|
|
|
window.open(url, "_blank");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [class='orderNums']").live("click", function () {
|
|
|
|
|
var mname = $(this).attr("mname");//获取当前行的userid
|
|
|
|
|
var url = "../DingDan/DD_OrderListForTM2.aspx?pMName=" + mname + "&pSDate=" + $("#txtSDate").val() + "&pEDate=" + $("#txtEDate").val();
|
|
|
|
|
window.open(url, "_blank");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [class='bztxt']").live("blur", function () {
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.userid = $(this).attr('userid');
|
|
|
|
|
param.username = $(this).attr('username');
|
|
|
|
|
param.remark = $(this).val();
|
|
|
|
|
param.platid = $(this).attr('platid');
|
|
|
|
|
param.isgroup = $(this).attr('isgroup');
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/UpdatePeopleSaleDataRemark",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d.Code == 0) {
|
|
|
|
|
alert(data.d.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [class='pcategories']").live("blur", function () {
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.userid = $(this).attr('userid');
|
|
|
|
|
param.username = $(this).attr('username');
|
|
|
|
|
param.categorys = $(this).val();
|
|
|
|
|
param.platid = $(this).attr('platid');
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/UpdatePeopleSaleDataPCategory",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d.Code == 0) {
|
|
|
|
|
alert(data.d.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " td:has(span.p_categories)").live("click", function () {
|
|
|
|
|
var categorys = $(this).find("span.p_categories").text();
|
|
|
|
|
pUserId = $(this).find("span.p_categories").attr("userid");
|
|
|
|
|
pPlatId = $(this).find("span.p_categories").attr("platid");
|
|
|
|
|
pUserName = $(this).find("span.p_categories").attr("username");
|
|
|
|
|
pIsGroup = $(this).find("span.p_categories").attr("isgroup");
|
|
|
|
|
nowSpan = $(this).find("span.p_categories");
|
|
|
|
|
fopen2(categorys);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [class='btnDetail']").live("click", function () {
|
|
|
|
|
debugger;
|
|
|
|
|
var userId = $(this).attr("userid");//获取当前行的userid
|
|
|
|
|
var platid = $(this).attr('platid');
|
|
|
|
|
var sDate = $("#txtSDate").val();
|
|
|
|
|
var eDate = $("#txtEDate").val();
|
|
|
|
|
var url = "../TongJi/PeopleGoodsSaleDatas.aspx?userid=" + userId + "&platId=" + platid + "&sDate=" + sDate + "&eDate=" + eDate;
|
|
|
|
|
window.open(url, "_blank");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [class='openGroup']").live("click", function () {
|
|
|
|
|
var userid = $(this).attr("UserId");
|
|
|
|
|
var groupdata = $("#" + datagrid1.TableID + " tr[groupuserid='" + userid + "']");
|
|
|
|
|
if ($(this).text() === "+") {
|
|
|
|
|
$(this).text('-');
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " tr[groupuserid='" + userid + "']").css('display', '');
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$(this).text('+');
|
|
|
|
|
$("#" + datagrid1.TableID + " tr[groupuserid='" + userid + "']").css('display', 'none');
|
|
|
|
|
}
|
|
|
|
|
datagrid1.Init();
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 初始化DataGrid
|
|
|
|
|
function CreateDataGrid() {
|
|
|
|
|
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "人员";
|
|
|
|
|
col.CellTemplate = "<a class='UserId{Bind UserId}' href='../HuoWu/HW_GoodsDetailList2.aspx?userid={Bind UserId}' style='text-decoration: none;' target='_blank'>{Bind Name}</a>";
|
|
|
|
|
col.Width = "150px";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "产品类目";
|
|
|
|
|
col.CellTemplate = "<span class='p_categories' userid={Bind UserId} platid={Bind PlatId} username={Bind Name} isgroup={Bind IsGroup}>{Bind Categorys}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "广告花费($)";
|
|
|
|
|
col.CellTemplate = "<span style='color:#34A3D1;' class='adDetails' userid={Bind UserId}>{Bind AdFee}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "订单数量";
|
|
|
|
|
col.CellTemplate = "<span style='color:#34A3D1;' class='orderNums' mname={Bind Name}>{Bind OrdersNum}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "销售额($)";
|
|
|
|
|
col.CellTemplate = "<a>{Bind SalePrice}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "投产比(%)";
|
|
|
|
|
col.CellTemplate = "<span>{Bind AdProductZB}</span>/<span style='{Bind TCBColor}'>{Bind TCB}</span>";
|
|
|
|
|
col.Width = "100px";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "利润($)";
|
|
|
|
|
col.CellTemplate = "<a>{Bind NetProfit}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "广告订单数量";
|
|
|
|
|
col.CellTemplate = "<a>{Bind AdOrdersNum}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "广告销售额($)";
|
|
|
|
|
col.CellTemplate = "<a>{Bind AdOrderAmount}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "广告利润($)";
|
|
|
|
|
col.CellTemplate = "<a>{Bind AdOrderLR}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "库存总金额(¥)";
|
|
|
|
|
col.CellTemplate = "<span style='color:#34A3D1;' class='stockDetails' userid={Bind UserId}>{Bind StockTotalPrice}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "仓储费($)";
|
|
|
|
|
col.CellTemplate = "<a>{Bind DayTotalSolidFee}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "H净利($)";
|
|
|
|
|
col.CellTemplate = "<a>{Bind HJLR}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "月H净利($)";
|
|
|
|
|
col.CellTemplate = "<a>{Bind HJLRForMonth}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (UserId == 1) {
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "补贴金额($)";
|
|
|
|
|
col.CellTemplate = "<a>{Bind SubsidyFee}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "百分比(%)";
|
|
|
|
|
col.CellTemplate = "<a>{Bind HJLRPercent}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "备注";
|
|
|
|
|
col.CellTemplate = "<input class='bztxt' type='text' value='{Bind Remakes}' userid={Bind UserId} platid={Bind PlatId} username={Bind Name} isgroup={Bind IsGroup} />";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "销售额天图表";
|
|
|
|
|
col.CellTemplate = "<div class='chart-cell' userid={Bind UserId} platid={Bind PlatId}></div>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "销售额月图表";
|
|
|
|
|
col.CellTemplate = "<div class='mchart-cell' userid={Bind UserId}></div>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "H净利当月图表";
|
|
|
|
|
col.CellTemplate = "<div class='hchart-cell' userid={Bind UserId} platid={Bind PlatId}></div>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "操作";
|
|
|
|
|
col.Width = "180px";
|
|
|
|
|
col.CellTemplate = "<input onclick='GoToGoodsDetail(this)' class='btnClass btnDetail' userid={Bind UserId} platid={Bind PlatId} isgroup={Bind IsGroup} type='button' value='商品详情'></input>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
datagrid1.SetPageSize(100);
|
|
|
|
|
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(); });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 读取数据
|
|
|
|
|
function ReadData() {
|
|
|
|
|
if ($("#txtSDate").val() == "") {
|
|
|
|
|
alert("请输入开始日期");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($("#txtEDate").val() == "") {
|
|
|
|
|
alert("请输入结束日期");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.SDate = $("#txtSDate").val();
|
|
|
|
|
param.EDate = $("#txtEDate").val();
|
|
|
|
|
var _userid = $("#select_name").val();
|
|
|
|
|
if (_userid == null) {
|
|
|
|
|
param.userid = UserId;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
param.userid = $("#select_name").val();
|
|
|
|
|
}
|
|
|
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
|
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/GetPeopleDaySaleDatasNew",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
datagrid1.Set_RowCount(data.d.RowCount);
|
|
|
|
|
datagrid1.DataBind(data.d.DataSource);
|
|
|
|
|
|
|
|
|
|
$("#DataGrid1_Table td a.UserId-2,a.UserId-3,a.UserId-4,a.UserId-5,a.UserId-6,a.UserId-7,a.UserId-8,a.UserId-9,a.UserId-10,a.UserId-11,a.UserId-12").closest("tr").find("a").css("color", "red");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreateTDsEchart(data.d.DataSource);
|
|
|
|
|
|
|
|
|
|
CreateTDsMonthEchart(data.d.DataSource);
|
|
|
|
|
|
|
|
|
|
CreateTDsHEchart(data.d.DataSource);
|
|
|
|
|
|
|
|
|
|
$('#DataGrid1_Table th:contains("广告花费"):first').attr('title', '人员管理商品的广告花费总额');
|
|
|
|
|
$('#DataGrid1_Table th:contains("销售额"):first').attr('title', '人员管理商品的销售总额');
|
|
|
|
|
$('#DataGrid1_Table th:contains("投产比"):first').attr('title', '广告花费/广告销售额,广告花费/销售额');
|
|
|
|
|
$('#DataGrid1_Table th:contains("利润"):first').attr('title', '订单未减去广告花费和仓储费的利润');
|
|
|
|
|
$('#DataGrid1_Table th:contains("仓储费"):first').attr('title', '亚马逊取所有商品的仓储费,wayfair和沃尔玛仓储费是算5%,eaby200美元以上算2个的仓储费,200以下算10%,Shopify的EM-SH店铺是所有电器类商品仓储费的2%,boson取所有商品的2%,luckymore取0.5%,KM取0.1%');
|
|
|
|
|
$('#DataGrid1_Table th:contains("H净利"):first').attr('title', 'H净利=利润-广告花费-仓储费');
|
|
|
|
|
$('#DataGrid1_Table th:contains("月H净利"):first').attr('title', '当前月份每天的H净利相加之和');
|
|
|
|
|
|
|
|
|
|
AddTR();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function AddTR() {
|
|
|
|
|
var trs = $("#" + datagrid1.TableID + " tr");
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " tbody tr").each(function (i) {
|
|
|
|
|
var model = datagrid1.Get_Model(i);
|
|
|
|
|
if (model.GroupPeopleDatas != null && model.GroupPeopleDatas.length > 0) {
|
|
|
|
|
$(this).find('td:first').prepend("<b class='openGroup' UserId='" + model.UserId + "' style='float:left;font-size:15px;'>+</b>")
|
|
|
|
|
for (var j = 0; j < model.GroupPeopleDatas.length; j++){
|
|
|
|
|
var data = model.GroupPeopleDatas[j];
|
|
|
|
|
var html = "<tr name='DataGridRow' class='DataGridRowStyle' GroupUserId='" + data.GroupUserId + "' style='display:none;' ><td style='width:150px; text-align:right;'><a href='../HuoWu/HW_GoodsDetailList2.aspx?userid=" + data.UserId + "' style='text-decoration: none;color:green;' target='_blank'>" + data.Name + "</a></td><td><span class='p_categories' userid='" + data.UserId + "' platid='" + data.PlatId + "' username='" + data.Name + "' isgroup='" + data.IsGroup + "' >" + (data.Categorys == null ? "" : data.Categorys) + "</span></td><td><span style='color:#34A3D1;' class='adDetails' userid='" + data.UserId + "'>" + (data.AdFee == null ? "" : data.AdFee) + "</span></td><td><span style='color:#34A3D1;' class='orderNums' mname='" + data.Name + "'>" + (data.OrdersNum == null ? "" : data.OrdersNum) + "</span></td><td><a>" + (data.SalePrice == null ? "" : data.SalePrice) + "</a></td><td><span>" + (data.AdProductZB == null ? "" : data.AdProductZB) + "</span>/<span style='color:black'>" + (data.TCB == null ? "" : data.TCB) + "</span></td><td><a>" + (data.NetProfit == null ? "" : data.NetProfit) + "</a></td><td><a>" + (data.AdOrdersNum == null ? "" : data.AdOrdersNum) + "</a></td><td><a>" + (data.AdOrderAmount == null ? "" : data.AdOrderAmount) + "</a></td><td><a>" + (data.AdOrderLR == null ? "" : data.AdOrderLR) + "</></td><td><span style='color:#34A3D1;' class='stockDetails' userid='" + data.UserId + "'>" + (data.StockTotalPrice == null ? "" : data.StockTotalPrice) + "</span></td><td><a>" + (data.DayTotalSolidFee == null ? "" : data.DayTotalSolidFee) + "</a></td><td><a>" + (data.HJLR == null ? "" : data.HJLR) + "</a></td><td><a>" + (data.HJLRForMonth == null ? "" : data.HJLRForMonth) + "</a></td> " + (UserId = 1 ? ("<td><a>" + (data.SubsidyFee == null ? "" : data.SubsidyFee) + "</a></td>") : "") + "<td><a>" + (data.HJLRPercent == null ? "" : data.HJLRPercent) + "</a></td><td><input class='bztxt' type='text' value='" + (data.Remakes == null ? "" : data.Remakes) + "' userid='" + data.UserId + "' platid='" + data.PlatId + "' username='" + data.Name + "' isgroup='" + data.IsGroup + "'></td><td><div class='chart-cell' userid='" + data.UserId + "' platid='" + data.PlatId + "'></div></td><td><div class='mchart-cell' userid='" + data.UserId + "' platid='" + data.PlatId + "'></div></td><td><div class='hchart-cell' userid='" + data.userId + "' platid='" + data.PlatId + "'></div></td><td style='width:180px;'><input onclick='GoToGoodsDetail(this)' class='btnClass btnDetail' userid='" + data.UserId + "' platid='" + data.PlatId + "' isgroup='" + data.IsGroup + "' type='button' value='商品详情'></td></tr>";
|
|
|
|
|
$(this).after(html);
|
|
|
|
|
var chart = $(this).nextAll('tr:eq(0)').find('td div.chart-cell');
|
|
|
|
|
CreateOneTDsEchart(chart[0], data.datas);
|
|
|
|
|
|
|
|
|
|
var m_chart = $(this).nextAll('tr:eq(0)').find('td div.mchart-cell');
|
|
|
|
|
CreateOneTDsMonthEchart(m_chart[0], data.mdatas);
|
|
|
|
|
|
|
|
|
|
var h_chart = $(this).nextAll('tr:eq(0)').find('td div.hchart-cell');
|
|
|
|
|
CreateOneTDsHEchart(h_chart[0], data.hdatas);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ReadUser() {
|
|
|
|
|
if (UserId == 1 || UserId == 51 || UserId == 53 || UserId==225)
|
|
|
|
|
$("#select_name").append("<option value='0'>全部</option>");
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/GetAllListJC_UserInfo",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
$(data.d).each(function () {
|
|
|
|
|
if (UserId != 1 && UserId != 51 && this.UserId == UserId && UserId != 53 && UserId!=225)
|
|
|
|
|
$("#select_name").append("<option value='" + this.UserId + "'>" + this.Name + "</option>");
|
|
|
|
|
else
|
|
|
|
|
if (UserId == 1 || UserId == 51 || UserId == 53 || UserId==225)
|
|
|
|
|
$("#select_name").append("<option value='" + this.UserId + "'>" + this.Name + "</option>");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//渲染每一行的折线图
|
|
|
|
|
function CreateTDsEchart(datas) {
|
|
|
|
|
var chartCells = $('.chart-cell');
|
|
|
|
|
|
|
|
|
|
chartCells.each(function () {
|
|
|
|
|
var chart = echarts.init(this); // this 代表当前的 chart-cell 元素
|
|
|
|
|
var userid = $(this).attr("userid");//获取当前行的userid
|
|
|
|
|
var _datas = datas.find(r => r.UserId == userid);
|
|
|
|
|
|
|
|
|
|
var data = _datas.datas.map(function (i) {
|
|
|
|
|
return { name: i.RDate, value: i.TotalPrice };
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//var data = [ // 示例数据
|
|
|
|
|
// { name: 'Value 1', value: 10 },
|
|
|
|
|
// { name: 'Value 2', value: 20 },
|
|
|
|
|
// { name: 'Value 3', value: 30 }
|
|
|
|
|
//];
|
|
|
|
|
|
|
|
|
|
var option = {
|
|
|
|
|
grid: {
|
|
|
|
|
left: 5,
|
|
|
|
|
right: 5,
|
|
|
|
|
top: 5,
|
|
|
|
|
bottom: 5,
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.name;
|
|
|
|
|
}),
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 x 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 x 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 x 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 y 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 y 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 y 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.value;
|
|
|
|
|
}),
|
|
|
|
|
lineStyle: {
|
|
|
|
|
width: 1 // 短线宽度
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
borderWidth: 0.5, // 点边框宽度
|
|
|
|
|
borderColor: 'black' // 点边框颜色
|
|
|
|
|
},
|
|
|
|
|
symbolSize: 2 // 点大小
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 设置容器尺寸
|
|
|
|
|
chart.resize({
|
|
|
|
|
width: 200,
|
|
|
|
|
height: 30
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
chart.setOption(option);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//渲染每一行月图表的折线图
|
|
|
|
|
function CreateTDsMonthEchart(datas) {
|
|
|
|
|
var chartCells = $('.mchart-cell');
|
|
|
|
|
|
|
|
|
|
chartCells.each(function () {
|
|
|
|
|
var chart = echarts.init(this); // this 代表当前的 chart-cell 元素
|
|
|
|
|
var userid = $(this).attr("userid");//获取当前行的userid
|
|
|
|
|
var _datas = datas.find(r => r.UserId == userid);
|
|
|
|
|
|
|
|
|
|
var data = _datas.mdatas.map(function (i) {
|
|
|
|
|
return { name: i.RDate, value: i.TotalPrice };
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var option = {
|
|
|
|
|
grid: {
|
|
|
|
|
left: 5,
|
|
|
|
|
right: 5,
|
|
|
|
|
top: 5,
|
|
|
|
|
bottom: 5,
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.name;
|
|
|
|
|
}),
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 x 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 x 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 x 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 y 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 y 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 y 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.value;
|
|
|
|
|
}),
|
|
|
|
|
lineStyle: {
|
|
|
|
|
width: 1 // 短线宽度
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
borderWidth: 0.5, // 点边框宽度
|
|
|
|
|
borderColor: 'black' // 点边框颜色
|
|
|
|
|
},
|
|
|
|
|
symbolSize: 2 // 点大小
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 设置容器尺寸
|
|
|
|
|
chart.resize({
|
|
|
|
|
width: 200,
|
|
|
|
|
height: 30
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
chart.setOption(option);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//渲染每一行的折线图
|
|
|
|
|
function CreateTDsHEchart(datas) {
|
|
|
|
|
var chartCells = $('.hchart-cell');
|
|
|
|
|
|
|
|
|
|
chartCells.each(function () {
|
|
|
|
|
var chart = echarts.init(this); // this 代表当前的 chart-cell 元素
|
|
|
|
|
var userid = $(this).attr("userid");//获取当前行的userid
|
|
|
|
|
var platid = $(this).attr("platid");//获取当前行的platid
|
|
|
|
|
//if (platid != 2 && platid != 0) {
|
|
|
|
|
// return true;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
var _datas = datas.find(r => r.UserId == userid && r.PlatId == platid);
|
|
|
|
|
|
|
|
|
|
if (_datas.hdatas == null) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var data = _datas.hdatas.map(function (i) {
|
|
|
|
|
return { name: i.RDate, value: i.TotalPrice };
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var option = {
|
|
|
|
|
grid: {
|
|
|
|
|
left: 5,
|
|
|
|
|
right: 5,
|
|
|
|
|
top: 5,
|
|
|
|
|
bottom: 5,
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.name;
|
|
|
|
|
}),
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 x 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 x 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 x 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 y 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 y 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 y 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.value;
|
|
|
|
|
}),
|
|
|
|
|
lineStyle: {
|
|
|
|
|
width: 1 // 短线宽度
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
borderWidth: 0.5, // 点边框宽度
|
|
|
|
|
borderColor: 'black' // 点边框颜色
|
|
|
|
|
},
|
|
|
|
|
symbolSize: 2 // 点大小
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 设置容器尺寸
|
|
|
|
|
chart.resize({
|
|
|
|
|
width: 200,
|
|
|
|
|
height: 30
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
chart.setOption(option);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//打开弹出框
|
|
|
|
|
function fopen() {
|
|
|
|
|
|
|
|
|
|
$.fancybox({
|
|
|
|
|
'width': '60%',
|
|
|
|
|
'height': '60%',
|
|
|
|
|
'autoScale': false,
|
|
|
|
|
'transitionIn': 'elastic',
|
|
|
|
|
'transitionOut': 'elastic',
|
|
|
|
|
'href': '#test',
|
|
|
|
|
'onComplete': function () {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//打开弹出框
|
|
|
|
|
function fopen2(categoryStr) {
|
|
|
|
|
$.fancybox({
|
|
|
|
|
'width': '60%',
|
|
|
|
|
'height': '60%',
|
|
|
|
|
'autoScale': false,
|
|
|
|
|
'transitionIn': 'elastic',
|
|
|
|
|
'transitionOut': 'elastic',
|
|
|
|
|
'href': '#test2',
|
|
|
|
|
'onComplete': function () {
|
|
|
|
|
$("input[name='pc_cheb']").prop("checked", false);
|
|
|
|
|
if (categoryStr != '' && categoryStr.length > 0) {
|
|
|
|
|
var categorys = categoryStr.split(',');
|
|
|
|
|
$("input[name='pc_cheb']").each(function (i) {
|
|
|
|
|
var cate = $(this).val();
|
|
|
|
|
var cateobj = categorys.find(r => r == cate);
|
|
|
|
|
if (cateobj != null && cateobj != 'undefined') {
|
|
|
|
|
$(this).prop("checked", true);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getZXTdate() {
|
|
|
|
|
// 获取当前日期
|
|
|
|
|
var currentDate = new Date();
|
|
|
|
|
|
|
|
|
|
// 判断当前日期是否为1号
|
|
|
|
|
if (currentDate.getDate() === 1) {
|
|
|
|
|
// 如果当前日期为1号,则获取上个月的第一天和最后一天日期
|
|
|
|
|
var lastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1);
|
|
|
|
|
var firstDay = new Date(lastMonth.getFullYear(), lastMonth.getMonth(), 1);
|
|
|
|
|
var lastDay = new Date(lastMonth.getFullYear(), lastMonth.getMonth() + 1, 0);
|
|
|
|
|
$("#zxTxtSDate").val(formatDate(firstDay));
|
|
|
|
|
$("#zxTxtEDate").val(formatDate(lastDay));
|
|
|
|
|
} else {
|
|
|
|
|
// 如果当前日期不是1号,则获取当前日期所在月的一号到当前日期前一天的日期
|
|
|
|
|
var firstDay = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
|
|
|
|
|
var lastDay = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() - 1);
|
|
|
|
|
$("#zxTxtSDate").val(formatDate(firstDay));
|
|
|
|
|
$("#zxTxtEDate").val(formatDate(lastDay));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//日期格式化yyyy-MM-dd
|
|
|
|
|
function formatDate(date) {
|
|
|
|
|
var year = date.getFullYear();
|
|
|
|
|
var month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
var day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
|
|
|
|
|
return year + '-' + month + '-' + day;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取弹出框折线图数据
|
|
|
|
|
function CraeteBigZXTData() {
|
|
|
|
|
if ($("#zxTxtSDate").val() == "") {
|
|
|
|
|
alert("开始日期不能为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var startDate = $("#zxTxtSDate").val();
|
|
|
|
|
if ($("#zxTxtEDate").val() == "") {
|
|
|
|
|
alert("结束日期不能为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var endDate = $("#zxTxtEDate").val();
|
|
|
|
|
if ($('[name="dataType"]:checked').val() == "") {
|
|
|
|
|
alert("请选择一种数据类型");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var dataType = $('[name="dataType"]:checked').val();
|
|
|
|
|
|
|
|
|
|
if ($('[name="dateType"]:checked').val() == "") {
|
|
|
|
|
alert("请选择一种日期类型");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var dateType = $('[name="dateType"]:checked').val();
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.sDate = startDate;
|
|
|
|
|
param.eDate = endDate;
|
|
|
|
|
param.userid = tcUserId;
|
|
|
|
|
param.platid = tcPlatId;
|
|
|
|
|
param.dataType = dataType;
|
|
|
|
|
param.dateType = dateType;
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/GetPeopleDayZXTDatas",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
CreateBitZXT(data.d);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//生成弹出框折线图
|
|
|
|
|
function CreateBitZXT(data) {
|
|
|
|
|
|
|
|
|
|
var divElement = document.getElementById('bigZXT');
|
|
|
|
|
var myChart = echarts.init(divElement);
|
|
|
|
|
var xdata = data.map(function (item) {
|
|
|
|
|
return item.Name;
|
|
|
|
|
});
|
|
|
|
|
var ydata = data.map(function (item) {
|
|
|
|
|
return item.Value;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var option = {
|
|
|
|
|
grid: {
|
|
|
|
|
left: 100,
|
|
|
|
|
right: 20,
|
|
|
|
|
top: 20,
|
|
|
|
|
bottom: 20
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: xdata,
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: true // 显示 x 轴刻度值
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: true // 隐藏 y 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: true // 隐藏 y 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: true // 隐藏 y 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: ydata,
|
|
|
|
|
label: {
|
|
|
|
|
show: true, // 显示标签
|
|
|
|
|
formatter: '{c}', // 标签的格式化字符串,{c}表示节点的值
|
|
|
|
|
position: 'top', // 标签的位置,可以是 'inside', 'left', 'right', 'top', 'bottom'
|
|
|
|
|
textStyle: {
|
|
|
|
|
color: '#000' // 标签的文字颜色
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
lineStyle: {
|
|
|
|
|
width: 1 // 短线宽度
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
borderWidth: 0.5, // 点边框宽度
|
|
|
|
|
borderColor: 'black' // 点边框颜色
|
|
|
|
|
},
|
|
|
|
|
symbolSize: 2 // 点大小
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//// 设置容器尺寸
|
|
|
|
|
//myChart.resize({
|
|
|
|
|
// width: 800,
|
|
|
|
|
// height: 400
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
myChart.setOption(option);
|
|
|
|
|
};
|
|
|
|
|
//日期改变触发
|
|
|
|
|
function filtChange() {
|
|
|
|
|
CraeteBigZXTData();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//获取产品分类
|
|
|
|
|
function GetGoodSortDatas() {
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/GetHWGoodsSortDatas",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
var htmlStr = "";
|
|
|
|
|
for (var i = 0; i < data.d.length; i++) {
|
|
|
|
|
htmlStr += "<input type='checkbox' name='pc_cheb' value='" + data.d[i]["SortName"] + "' />" + data.d[i]["SortName"];
|
|
|
|
|
}
|
|
|
|
|
$("#che_pcategory").append(htmlStr);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//保存产品分类
|
|
|
|
|
function SaveCategorys() {
|
|
|
|
|
|
|
|
|
|
// 获取所有选中状态的name为pc_cheb的checkbox的value值
|
|
|
|
|
var checkedValues = $("input[name='pc_cheb']:checked").map(function () {
|
|
|
|
|
return this.value;
|
|
|
|
|
}).get();
|
|
|
|
|
|
|
|
|
|
// 将value值用逗号拼接成一个字符串
|
|
|
|
|
var joinedValues = checkedValues.join(",");
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.userid = pUserId;
|
|
|
|
|
param.platid = pPlatId;
|
|
|
|
|
param.userName = pUserName;
|
|
|
|
|
param.isgroup = pIsGroup;
|
|
|
|
|
param.categorys = joinedValues;
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/UpdatePeopleSaleDataPCategory",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d.Code == 0) {
|
|
|
|
|
alert(data.d.Message);
|
|
|
|
|
} else {
|
|
|
|
|
nowSpan.text(joinedValues);
|
|
|
|
|
}
|
|
|
|
|
$.fancybox.close();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//#region 删除
|
|
|
|
|
function GoToGoodsDetail(obj) {
|
|
|
|
|
debugger;
|
|
|
|
|
console.log(obj);
|
|
|
|
|
var userId = $(obj).attr("userid");//获取当前行的userid
|
|
|
|
|
var platid = $(obj).attr('platid');
|
|
|
|
|
var sDate = $("#txtSDate").val();
|
|
|
|
|
var eDate = $("#txtEDate").val();
|
|
|
|
|
var isGroup = $(obj).attr("isgroup");
|
|
|
|
|
var url = "../TongJi/PeopleGoodsSaleDatas.aspx?userid=" + userId + "&platId=" + platid + "&isGroup=" + isGroup + "&sDate=" + sDate + "&eDate=" + eDate;
|
|
|
|
|
window.open(url, "_blank");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//渲染每一行的折线图
|
|
|
|
|
function CreateOneTDsEchart(obj, datas) {
|
|
|
|
|
var chart = echarts.init(obj); // obj 代表当前的 chart-cell 元素
|
|
|
|
|
var data = datas.map(function (i) {
|
|
|
|
|
return { name: i.RDate, value: i.TotalPrice };
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var option = {
|
|
|
|
|
grid: {
|
|
|
|
|
left: 5,
|
|
|
|
|
right: 5,
|
|
|
|
|
top: 5,
|
|
|
|
|
bottom: 5,
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.name;
|
|
|
|
|
}),
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 x 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 x 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 x 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 y 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 y 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 y 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.value;
|
|
|
|
|
}),
|
|
|
|
|
lineStyle: {
|
|
|
|
|
width: 1 // 短线宽度
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
borderWidth: 0.5, // 点边框宽度
|
|
|
|
|
borderColor: 'black' // 点边框颜色
|
|
|
|
|
},
|
|
|
|
|
symbolSize: 2 // 点大小
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 设置容器尺寸
|
|
|
|
|
chart.resize({
|
|
|
|
|
width: 200,
|
|
|
|
|
height: 30
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
chart.setOption(option);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//渲染每一行月图表的折线图
|
|
|
|
|
function CreateOneTDsMonthEchart(obj,datas) {
|
|
|
|
|
|
|
|
|
|
var chart = echarts.init(obj); // this 代表当前的 chart-cell 元素
|
|
|
|
|
|
|
|
|
|
var data = datas.map(function (i) {
|
|
|
|
|
return { name: i.RDate, value: i.TotalPrice };
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var option = {
|
|
|
|
|
grid: {
|
|
|
|
|
left: 5,
|
|
|
|
|
right: 5,
|
|
|
|
|
top: 5,
|
|
|
|
|
bottom: 5,
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.name;
|
|
|
|
|
}),
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 x 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 x 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 x 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 y 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 y 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 y 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.value;
|
|
|
|
|
}),
|
|
|
|
|
lineStyle: {
|
|
|
|
|
width: 1 // 短线宽度
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
borderWidth: 0.5, // 点边框宽度
|
|
|
|
|
borderColor: 'black' // 点边框颜色
|
|
|
|
|
},
|
|
|
|
|
symbolSize: 2 // 点大小
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 设置容器尺寸
|
|
|
|
|
chart.resize({
|
|
|
|
|
width: 200,
|
|
|
|
|
height: 30
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
chart.setOption(option);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//渲染每一行的折线图
|
|
|
|
|
function CreateOneTDsHEchart(obj,datas) {
|
|
|
|
|
var chart = echarts.init(obj); // this 代表当前的 chart-cell 元素
|
|
|
|
|
|
|
|
|
|
var data = datas.map(function (i) {
|
|
|
|
|
return { name: i.RDate, value: i.TotalPrice };
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var option = {
|
|
|
|
|
grid: {
|
|
|
|
|
left: 5,
|
|
|
|
|
right: 5,
|
|
|
|
|
top: 5,
|
|
|
|
|
bottom: 5,
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.name;
|
|
|
|
|
}),
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 x 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 x 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 x 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLabel: {
|
|
|
|
|
show: false // 隐藏 y 轴标签
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false // 隐藏 y 轴刻度线
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false // 隐藏 y 轴线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: data.map(function (item) {
|
|
|
|
|
return item.value;
|
|
|
|
|
}),
|
|
|
|
|
lineStyle: {
|
|
|
|
|
width: 1 // 短线宽度
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
borderWidth: 0.5, // 点边框宽度
|
|
|
|
|
borderColor: 'black' // 点边框颜色
|
|
|
|
|
},
|
|
|
|
|
symbolSize: 2 // 点大小
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 设置容器尺寸
|
|
|
|
|
chart.resize({
|
|
|
|
|
width: 200,
|
|
|
|
|
height: 30
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
chart.setOption(option);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
table {
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
td, th {
|
|
|
|
|
border: 1px solid black;
|
|
|
|
|
padding: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chart-cell {
|
|
|
|
|
width: 200px;
|
|
|
|
|
height: 30px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<body class="headbody">
|
|
|
|
|
<div style="display: none">
|
|
|
|
|
<div id="test" title="折线图" style="width: 1600px; height: 600px;">
|
|
|
|
|
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="13%">日期:</td>
|
|
|
|
|
<td><input id="zxTxtSDate" class="editTextbox" style="width: 120px;" type="text" onfocus="WdatePicker()" autocomplete="off" onchange="filtChange()" />-<input id="zxTxtEDate" class="editTextbox" style="width: 120px;" type="text" onfocus="WdatePicker()" autocomplete="off" onchange="filtChange()" /></td>
|
|
|
|
|
<td class="f1" width="13%">日期类型:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input type="radio" id="d_day" name="dateType" value="1" checked /><label for="d_day">天</label>
|
|
|
|
|
<input type="radio" id="d_month" name="dateType" value="2" /><label for="d_month">月</label>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="13%">数据类型:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input type="radio" id="r_adfee" name="dataType" value="1" /><label for="r_adfee">广告花费</label>
|
|
|
|
|
<input type="radio" id="r_orderNum" name="dataType" value="2" /><label for="r_orderNum">订单数量</label>
|
|
|
|
|
<input type="radio" id="r_salePrice" name="dataType" value="3" checked /><label for="r_salePrice">销售额</label>
|
|
|
|
|
<input type="radio" id="r_lr" name="dataType" value="4" /><label for="r_lr">利润</label>
|
|
|
|
|
<input type="radio" id="r_adOrderNum" name="dataType" value="5" /><label for="r_adOrderNum">广告订单数量</label>
|
|
|
|
|
<input type="radio" id="r_adSalePrice" name="dataType" value="6" /><label for="r_adSalePrice">广告销售额</label>
|
|
|
|
|
<input type="radio" id="r_adLR" name="dataType" value="7" /><label for="r_adLR">广告利润</label>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
</table>
|
|
|
|
|
<!--折线图-->
|
|
|
|
|
<div id="bigZXT" style="width:1400px;height:400px;margin-top:20px;">
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div style="display: none">
|
|
|
|
|
<div id="test2" title="产品类目" style="width: 400px; height: auto;">
|
|
|
|
|
<div id="che_pcategory" style="width:400px;height:200px;margin-top:20px;">
|
|
|
|
|
<%-- <input type="checkbox" name="pc_cheb" />运动
|
|
|
|
|
<input type="checkbox" name="pc_cheb" />生活
|
|
|
|
|
<input type="checkbox" name="pc_cheb" />婴儿
|
|
|
|
|
<input type="checkbox" name="pc_cheb" />汽车
|
|
|
|
|
<input type="checkbox" name="pc_cheb" />厨房
|
|
|
|
|
<input type="checkbox" name="pc_cheb" />桌椅--%>
|
|
|
|
|
</div>
|
|
|
|
|
<input id="Button1" type="button" value="保存" onclick="SaveCategorys()" style="float:right;"/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="title_ico">
|
|
|
|
|
个人销售数据
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<table id="tb1" class="tableAll" style="width: 100%;">
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="13%">人员:</td>
|
|
|
|
|
<td width="18%">
|
|
|
|
|
<select id="select_name" class="selectClass" style="width: 120px" name="D1"></select>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="f1" width="13%">日期:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="txtSDate" class="editTextbox" style="width: 120px;" type="text" onfocus="WdatePicker()" autocomplete="off" />-<input id="txtEDate" class="editTextbox" style="width: 120px;" type="text" onfocus="WdatePicker()" autocomplete="off" /></td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td valign="top" colspan="5">
|
|
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|