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.
351 lines
13 KiB
Plaintext
351 lines
13 KiB
Plaintext
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserOrderSale.aspx.cs"
|
|
Inherits="TradeManageNew.TongJi.UserOrderSale" %>
|
|
|
|
<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/ajaxfileupload.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 selectSDate = "";
|
|
var selectEDate = "";
|
|
$(document).ready(function () {
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
WindowLoadModel.Isbgiframe = true;
|
|
WindowLoadModel.Load();
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
CreateDataGrid();
|
|
|
|
$("#txtSDate").val(ConvertToDateStr(new Date()));
|
|
$("#txtEDate").val(ConvertToDateStr(new Date()));
|
|
GetBasePlat();
|
|
GetYYUser();
|
|
ReadData();
|
|
|
|
$("#btn_sch").bind("click", function () {
|
|
ReadData();
|
|
});
|
|
$("#btn_import").bind("click", function () {
|
|
Import();
|
|
});
|
|
|
|
$(`#${datagrid1.TableID} input[CommandName='showOrderDetail']`).live("click", function () {
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
userid = model.userid;
|
|
//var selectSDate = "";
|
|
//var selectEDate = "";
|
|
var newWindow = window.open(`UserOrderSaleDetailOrder.aspx?Title=订单详情&SelectUserId=${userid}&selectSDate=${selectSDate}&selectEDate=${selectEDate}`, '_blank');
|
|
//打开页面
|
|
});
|
|
});
|
|
// 查询
|
|
//#region 查询
|
|
var YYUserList = [];
|
|
function GetYYUser () {
|
|
var param = new Object();
|
|
//param.Id = newId;
|
|
param.isShowAllGroup = 0;
|
|
$.ajax({
|
|
url: "../CangKuServerNew.asmx/GetList_YYUser",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
async: false,
|
|
success: function (data) {
|
|
|
|
var html = new Sys.StringBuilder();
|
|
//html.append("<option value='-1'>选择</option>");
|
|
$(data.d).each(function () {
|
|
var YYUserModel = {};
|
|
YYUserModel["ID"] = this.ID;
|
|
YYUserModel["Name"] = this.Name;
|
|
YYUserList.push(YYUserModel);
|
|
html.append("<option value='" + this.ID + "'>" + this.Name + "</option>");
|
|
});
|
|
|
|
//判断数量
|
|
if (data.d.length > 1) {
|
|
$('#selec_YYUser').html("<option value='1'>全部</option>" + html.toString());
|
|
}
|
|
else {
|
|
$('#selec_YYUser').html(html.toString());
|
|
}
|
|
|
|
}
|
|
});
|
|
}
|
|
//#endregion
|
|
function GetBasePlat () {
|
|
|
|
$("#select_plat").append("<option value='0'>全部</option>");
|
|
var param = new Object();
|
|
param.CompanyID = 0;
|
|
param.KeyName = "ptlx";
|
|
WindowLoadModel.Show();
|
|
$.ajax({
|
|
url: "../BaseDataNew.asmx/GetPlatBaseCode",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
success: function (data) {
|
|
WindowLoadModel.Hide();
|
|
|
|
if (data.d != null) {
|
|
$(data.d).each(function () {
|
|
$("#select_plat").append("<option value='" + this.SortNo + "'>" + this.Name + "</option>");
|
|
});
|
|
GetShopList();
|
|
}
|
|
|
|
|
|
}
|
|
});
|
|
}
|
|
function ConvertToDateStr (dateStr) {
|
|
const date = new Date(dateStr);
|
|
const year = date.getFullYear();
|
|
const month = ("0" + (date.getMonth() + 1)).slice(-2);
|
|
const day = ("0" + date.getDate()).slice(-2);
|
|
return `${year}-${month}-${day}`;
|
|
};
|
|
|
|
//#region 读取数据
|
|
function ReadData () {
|
|
var param = new Object();
|
|
selectSDate = $("#txtSDate").val();
|
|
selectEDate = $("#txtEDate").val();
|
|
param.sDate = $("#txtSDate").val();
|
|
param.eDate = $("#txtEDate").val();
|
|
param.UserId = $("#selec_YYUser").val();
|
|
param.PlatId = $("#select_plat").val();
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
WindowLoadModel.Show();
|
|
$.ajax({
|
|
url: "../SysManageServiceNew.asmx/GetUserOrderSaleList",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
success: function (data) {
|
|
WindowLoadModel.Hide();
|
|
|
|
var showList = data.d.DataSource;
|
|
debugger
|
|
var showModel = {};
|
|
showModel["username"] = "总计";
|
|
showModel["PlatName"] = "全部";
|
|
var allOrderNum = 0;
|
|
var allRMBMoney = 0;
|
|
var allUSDMoney = 0;
|
|
var allyf = 0;
|
|
var allRate6 = 0;
|
|
var allmdfee = 0;
|
|
var allLR = 0;
|
|
var allJL = 0;
|
|
data.d.DataSource.map(t => {
|
|
allOrderNum += t.OrderNum
|
|
allRMBMoney += t.RMBMoney
|
|
allUSDMoney += t.USDMoney
|
|
allyf += t.yf
|
|
allRate6 += t.Rate6
|
|
allmdfee += t.mdfee
|
|
allLR += t.LR
|
|
allJL += t.JL
|
|
|
|
});
|
|
showModel["OrderNum"] = allOrderNum;
|
|
showModel["RMBMoney"] = allRMBMoney.toFixed(2);
|
|
showModel["USDMoney"] = allUSDMoney.toFixed(2);
|
|
showModel["yf"] = allyf.toFixed(2);
|
|
showModel["Rate6"] = allRate6.toFixed(2);
|
|
showModel["mdfee"] = allmdfee.toFixed(2);
|
|
showModel["LR"] = allLR.toFixed(2);
|
|
showModel["JL"] = allJL.toFixed(2);
|
|
|
|
showList.push(showModel);
|
|
datagrid1.Set_RowCount(data.d.RowCount);
|
|
datagrid1.DataBind(showList);
|
|
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
//#endregion
|
|
//#region 读取数据
|
|
function Import () {
|
|
var param = new Object();
|
|
param.sDate = $("#txtSDate").val();
|
|
param.eDate = $("#txtEDate").val();
|
|
param.UserId = $("#selec_YYUser").val();
|
|
param.PlatId = $("#select_plat").val();
|
|
|
|
var selectElement = document.getElementById('selec_YYUser');
|
|
var selectedOption = selectElement.options[selectElement.selectedIndex];
|
|
var selectedText = selectedOption.textContent || selectedOption.innerText;
|
|
//var fname = "汇总数据.xls";
|
|
var fname = `运营人员:${selectedText}/日期:${param.sDate}-${param.eDate}销售数据.xls`;
|
|
WindowLoadModel.Show();
|
|
$.ajax({
|
|
url: "../SysManageServiceNew.asmx/GetExcelFile_UserOrderSaleList",
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
contentType: "application/json",
|
|
async: true,
|
|
success: function (data) {
|
|
WindowLoadModel.Hide();
|
|
var filePath = data.d;
|
|
window.location = "../GlobalAshx/DownFile.ashx?filePath=" + encodeURIComponent(filePath) + "&fileName=" + encodeURIComponent(fname);
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
//#endregion
|
|
|
|
//#region 初始化DataGrid
|
|
function CreateDataGrid () {
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "销售人员";
|
|
col.CellTemplate = "<a href='../CangKu/CK_GoodsApplyAllNew.aspx?Title=认购SKU&SelectUserId={Bind userid}' target='_blank' class='linka'>{Bind username}</a>";
|
|
//col.CellTemplate = "<a>{Bind username}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "销售平台";
|
|
col.CellTemplate = "<a>{Bind PlatName}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "人员分配SKU个数";
|
|
col.CellTemplate = "<a>{Bind SkuNum}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "销售订单量";
|
|
//col.CellTemplate = "<a href='UserOrderSaleDetailOrder.aspx?Title=认购SKU&SelectUserId={Bind userid}' target='_blank' class='linka'>{Bind OrderNum}</a>";
|
|
col.CellTemplate = " <input CommandName='showOrderDetail' class='btnClass' type='button' value='{Bind OrderNum}'></input> "
|
|
//col.CellTemplate = "<a>{Bind OrderNum}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "销售金额/RMB";
|
|
col.CellTemplate = "<a>{Bind RMBMoney}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "销售金额/$";
|
|
col.CellTemplate = "<a style=\"color:{Bind USDMoneyColer};\">{Bind USDMoney}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "运费";
|
|
col.CellTemplate = "<a>{Bind yf}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "广告花费($)";
|
|
col.CellTemplate = "<span>{Bind Rate6}</span>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
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 = "预估利润";
|
|
col.CellTemplate = "<a>{Bind LR}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
col.HeaderText = "净利润";
|
|
col.CellTemplate = "<a>{Bind JL}</a>";
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
datagrid1.SetPageSize(50);
|
|
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
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
</head>
|
|
|
|
<body class="headbody">
|
|
|
|
<table id="tb1" class="tableAll" style="width: 100%;">
|
|
<tr>
|
|
<td class="td_f1" width="10%">运营人员</td>
|
|
<td>
|
|
<select id='selec_YYUser' style="width: 99%;" columnrequired="false"></select>
|
|
</td>
|
|
<td class="td_f1" width="10%">平台</td>
|
|
<td>
|
|
<select id='select_plat' style="width: 99%;" columnrequired="false"></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="查询" />
|
|
<input id="btn_import" class="btnClass btnClassFind" type="button" value="导出" />
|
|
</td>
|
|
<%-- <td>
|
|
<input id="btn_import" class="btnClass btnClassFind" type="button" value="导出" />
|
|
|
|
</td>--%>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top" colspan="7">
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
|
|
</html> |