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.

473 lines
17 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="Report8.aspx.cs" Inherits="TradeManage.TongJi.Report8" %>
<!DOCTYPE html>
<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 WindowLoadModel = new WindowLoad();
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
//ReadData();
// GetDepartMent();
var dd = new Date();
$("#txt_SDate").val(dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate());
$("#txt_EDate").val(dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate());
GetMoneyCode();
$("#btn_sch").bind("click", function () {
ReadData();
});
$("#txt_PersonFee").MaskedTextBox();
$("#btn_Edit").bind("click", function () {
fopen();
});
$("#btn_Cancel").bind("click", $.fancybox.close);
GetBasePlat();
GetShopList();
$("#select_dept,#select_plat").bind("change", function () {
GetShopList();
});
});
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>");
});
}
}
});
}
function GetShopList() {
$("#select_shop").empty();
$("#select_shop").append("<option value='0'>全部</option>");
var param = new Object();
param.DeptId = 0;
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;
}
var param = new Object();
param.PlatId = $("#select_plat").val();
param.SDate = $("#txt_SDate").val();
param.EDate = $("#txt_EDate").val();
param.Supplier = $("#txt_Supplier").val();
param.GoodsCode = $("#txt_GoodsOldCode").val();
param.ShopId = $("#select_shop").val();
WindowLoadModel.Show();
$.ajax({
url: "TJ_CountServer.asmx/GetReportTable8",
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 HB()
{
Rowsp(1);
return;
//var param = new Object();
//param.ReportId = 2;
//WindowLoadModel.Show();
//$.ajax({
// url: "TJ_CountServer.asmx/GetReportCols",
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
// //async: false,
// success: function (data) {
// WindowLoadModel.Hide();
// }
//});
$("#tb1 td[rowindex=1]").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 Rowsp(rowindex)
{
var content = "";
var rowspan = 1;
var trindx = -1;
$("#tb1 td[rowindex=" + rowindex + "]").each(function (i) {
if (content == $(this).html())
{
rowspan++;
$(this).hide();
}
else
{
if (rowspan > 1 && trindx>-1)
$("#tb1 td[rowindex=" + rowindex + "][rowtr=" + trindx + "]").attr("rowspan", rowspan);
trindx = $(this).attr("rowtr");
rowspan = 1;
}
content = $(this).html();
});
if (rowspan > 1 && trindx > -1)
$("#tb1 td[rowindex=" + rowindex + "][rowtr=" + trindx + "]").attr("rowspan", rowspan);
}
function ReadOff() {
$.ajax({
url: "TJ_CountServer.asmx/GetExpressOff",
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
datagrid2.DataBind(data.d);
$("input[eid]").MaskedTextBox();
}
});
}
function GetPersonFee() {
$.ajax({
url: "TJ_CountServer.asmx/GetPersonFee",
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
$("#a_PersonFee").html(data.d);
$("#txt_PersonFee").val(data.d);
}
});
}
function ExportData() {
if ($("#txt_SDate").val() == "") {
alert("请输入日期");
return;
}
var param = new Object();
param.PlatId = $("#select_plat").val();
param.SDate = $("#txt_SDate").val();
param.EDate = $("#txt_EDate").val();
param.Supplier = $("#txt_Supplier").val();
param.GoodsCode = $("#txt_GoodsOldCode").val();
param.ShopId = $("#select_shop").val();
var fname ="需要采购报表.xls";
$.ajax({
url: "TJ_CountServer.asmx/GetExcelTable8",
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);
}
});
}
function SetOffNum() {
var list = datagrid2.GetSelectListModel();
if (list == null || list.length == 0) {
alert("请选择要修改的物流渠道");
return;
}
if ($("#txt_OffNum").val() == "") {
alert("请输入批量修改的折扣");
return;
}
$(list).each(function () {
var id = this.ExpressPostID;
$("input[eid='" + id + "']").val($("#txt_OffNum").val());
});
}
function SaveOffNum() {
if ($("#txt_PersonFee").val() == "") {
alert("请填写人工费");
return;
}
datagrid2.UpdateDataSource();
var error = "";
$(datagrid2.DataSource).each(function () {
if (this.OffNum == null || this.OffNum == "")
error += this.Name + "折扣没填";
});
if (error != "") {
alert(error);
return;
}
var param = new Object();
param.list = datagrid2.DataSource;
param.PersonFee = -1;
if ($("#txt_PersonFee").val() != $("#a_PersonFee").html())
param.PersonFee = $("#txt_PersonFee").val();
$.ajax({
url: "TJ_CountServer.asmx/SaveExpressOff",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
alert("修改完成");
$("#txt_OffNum").val("");
ReadOff();
$("#a_PersonFee").html($("#txt_PersonFee").val())
$.fancybox.close();
}
});
}
</script>
</head>
<body class="headbody">
<div style="display: none">
<div id="test" title="物流折扣" style="width: 500px; height: 350px;">
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
<tr>
<td style="width: 110px;" class="f1">人工费:
</td>
<td colspan="2">
<a id="a_PersonFee" style="display: none"></a>
<input id="txt_PersonFee" type='text' min='1' max='10' precision='2' style='width: 100px;' class='editTextbox' value='' />元
<input id="Button1" type="button" value="确定" class="btnClass btnClassEdit" onclick="SetOffNum();" style="display: none" />
<font color="red">例如85折就填8.5</font>
</td>
</tr>
<tr>
<td align="left" colspan="3">
<div style="height: 280px; overflow: auto">
<div id="DataGrid2"></div>
</div>
</td>
</tr>
<tr>
<td align="center" colspan="3">
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="保 存" onclick="SaveOffNum();" />&nbsp;&nbsp;&nbsp;&nbsp;<input
id="btn_Cancel" type="button" class="btnClass btnClassClose" value="关 闭" />
</td>
</tr>
</table>
</div>
</div>
<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="22%">
<select id="select_plat" class="selectClass" style="width: 100px" name="D3">
</select><select id="select_shop" class="selectClass" style="width: 100px" name="D4">
</select></td>
<td class="f1" width="10%">日期:</td>
<td width="20%">
<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="导出报表" /></td>
</tr>
<tr>
<td class="f1" width="13%" >供应商:</td>
<td width="22%">
<input id="txt_Supplier" class="editTextbox" style="width: 120px;" type="text" /></td>
<td class="f1" width="10%">货物编号:</td>
<td width="20%">
<input id="txt_GoodsOldCode" class="editTextbox" style="width: 120px;" type="text" /></td>
<td class="f1" width="10%">&nbsp;</td>
</tr>
<tr>
<td valign="top" colspan="5">
<%-- 共3页 第<select id="select_page1" class="selectClass" style="width:50px" name="D4">
</select>页 每页<input id="txt_Num1" class="editTextbox" style="width:50px;" type="text" value="100"/>条 <br />--%>
<div style="width:100%"><table class="DataGridTableStyle" style="width:100%" id="tb1"></table></div>
<%-- <br />
共3页 第<select id="select_page" class="selectClass" style="width:50px" name="D4">
</select>页 每页<input id="txt_Num" class="editTextbox" style="width:50px;" type="text" value="100"/>条--%>
</td>
</tr>
</table>
</body>
</html>