Commit 6a3d2d9b by guanzhenshan

处理0410利润统计分析的问题和调整

parent d683869d
......@@ -288,7 +288,7 @@ namespace Bailun.DC.Models.Orders
public decimal cost_handle_platform { get; set; }
/// <summary>
/// 尾程费-人民币
/// 尾程费-人民币-真实的费用
/// </summary>
public decimal cost_tail { get; set; }
......@@ -418,5 +418,11 @@ namespace Bailun.DC.Models.Orders
/// </summary>
public int noshippingcount { get; set; }
/// <summary>
/// 物流费-根据LMS线路算出来的(尾程费)
/// </summary>
public decimal cost_logistics { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Warehouse
{
public class dc_mid_skuwarehouse_redundancy
{
/// <summary>
///
/// </summary>
public int id { get; set; }
/// <summary>
/// sku编码
/// </summary>
public string bailun_sku { get; set; }
/// <summary>
/// sku标题
/// </summary>
public string bailun_sku_name { get; set; }
/// <summary>
/// 仓库编码
/// </summary>
public string warehouse_code { get; set; }
/// <summary>
/// 仓库名称
/// </summary>
public string warehouse_name { get; set; }
/// <summary>
/// 产品个数
/// </summary>
public int productcount { get; set; }
/// <summary>
/// 库存总金额
/// </summary>
public decimal amount_total { get; set; }
/// <summary>
/// 日销产品个数(7日)
/// </summary>
public decimal daily_productsale_count { get; set; }
/// <summary>
/// 动销产品比例
/// </summary>
public decimal productsale_rate { get; set; }
/// <summary>
/// 日销金额
/// </summary>
public decimal dailysale_amount { get; set; }
/// <summary>
/// 动销金额比例
/// </summary>
public decimal saleamount_rate { get; set; }
/// <summary>
/// 冗余产品个数
/// </summary>
public int redundancy_product_count { get; set; }
/// <summary>
/// 冗余个数比例
/// </summary>
public decimal redundancy_product_rate { get; set; }
/// <summary>
/// 冗余产品金额
/// </summary>
public decimal redundancy_amount { get; set; }
/// <summary>
/// 冗余产品金额比例
/// </summary>
public decimal redundancy_amount_rate { get; set; }
/// <summary>
/// 昨日销量
/// </summary>
public int yesterdaysale_count { get; set; }
/// <summary>
/// 昨日销售金额
/// </summary>
public decimal yesterdaysale_amount { get; set; }
/// <summary>
/// 过去3天日均
/// </summary>
public decimal sale_3d_avg { get; set; }
/// <summary>
/// 过去7天日均
/// </summary>
public decimal sale_7d_avg { get; set; }
/// <summary>
/// 过去14天日均
/// </summary>
public decimal sale_14d_avg { get; set; }
/// <summary>
/// 过去30天日均
/// </summary>
public decimal sale_30d_avg { get; set; }
/// <summary>
/// 日周转率
/// </summary>
public decimal day_turnover_rate { get; set; }
/// <summary>
/// 周周转率
/// </summary>
public decimal week_turnover_rate { get; set; }
/// <summary>
/// 月周转率
/// </summary>
public decimal month_turnover_rate { get; set; }
/// <summary>
/// 缺货数
/// </summary>
public int stockout { get; set; }
/// <summary>
/// 统计日期
/// </summary>
public DateTime day { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime createtime { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Warehouse
{
public class mSkuInfo
{
public int id { get; set;}
public string bailun_sku { get; set; }
public decimal unit_price { get; set; }
public string sku_title_cn { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Warehouse
{
/// <summary>
/// 库存表
/// </summary>
public class mStock
{
public string bailun_sku { get; set; }
public string warehouse_code { get; set; }
public int usable_stock { get; set; }
}
}
......@@ -138,5 +138,89 @@ namespace Bailun.DC.Services
}
/// <summary>
/// 保存仓库冗余数据 (Sku+仓库维度)
/// </summary>
/// <returns></returns>
public string SaveSkuWarehouseRedundancy()
{
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
var liststock = cn.Query<Models.Warehouse.mStock>("select bailun_sku,warehouse_code,usable_stock from dc_base_stock");
foreach (var item in liststock)
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
var objsku = cn.QueryFirstOrDefault<Models.Warehouse.mSkuInfo>("select id,bailun_sku,unit_price,sku_title_cn from dc_base_sku where bailun_sku='" + item.bailun_sku + "'");
if (objsku == null)
{
continue;
}
var objWarehouse = cn.QueryFirstOrDefault<Models.dc_base_warehouse>("select id,warehouse_name from dc_base_warehouse where warehouse_code='" + item.warehouse_code + "'");
if (objWarehouse == null)
{
continue;
}
var date = DateTime.Parse(DateTime.Now.AddDays(-7).ToShortDateString());
var obj7SaleAvg = cn.QueryFirstOrDefault<decimal?>("select sum(bailun_sku_quantity_ordered) from dc_base_oms_sku where bailun_sku='"+item.bailun_sku+"' and warehouse_code='"+item.warehouse_code+"' and bailun_order_status!='Canceled' and paid_time>='"+ date.ToString("yyyy-MM-dd")+ "' and paid_time<'"+date.AddDays(7).ToString("yyyy-MM-dd")+"'");
var objRedundancy = cn.QueryFirstOrDefault<int?>("select quantity from dc_auto_forecast_fluctuation where type=3 and bailun_sku='"+item.bailun_sku+"' and warehouse_code='"+item.warehouse_code+"'");
var objYesterdaySale = cn.QueryFirstOrDefault<int?>("select sum(bailun_sku_quantity_ordered) from dc_base_oms_sku where bailun_sku='" + item.bailun_sku + "' and warehouse_code='" + item.warehouse_code + "' and bailun_order_status!='Canceled' and paid_time>='" + date.AddDays(5).ToString("yyyy-MM-dd") + "' and paid_time<'" + date.AddDays(6).ToString("yyyy-MM-dd") + "'");
var obj3SaleAvg = cn.QueryFirstOrDefault<decimal?>("select sum(bailun_sku_quantity_ordered) from dc_base_oms_sku where bailun_sku='" + item.bailun_sku + "' and warehouse_code='" + item.warehouse_code + "' and bailun_order_status!='Canceled' and paid_time>='" + date.AddDays(4).ToString("yyyy-MM-dd") + "' and paid_time<'" + date.AddDays(7).ToString("yyyy-MM-dd") + "'");
var obj14SaleAvg = cn.QueryFirstOrDefault<decimal?>("select sum(bailun_sku_quantity_ordered) from dc_base_oms_sku where bailun_sku='" + item.bailun_sku + "' and warehouse_code='" + item.warehouse_code + "' and bailun_order_status!='Canceled' and paid_time>='" + date.AddDays(-7).ToString("yyyy-MM-dd") + "' and paid_time<'" + date.AddDays(7).ToString("yyyy-MM-dd") + "'");
var obj30SaleAvg = cn.QueryFirstOrDefault<decimal?>("select sum(bailun_sku_quantity_ordered) from dc_base_oms_sku where bailun_sku='" + item.bailun_sku + "' and warehouse_code='" + item.warehouse_code + "' and bailun_order_status!='Canceled' and paid_time>='" + date.AddDays(-23).ToString("yyyy-MM-dd") + "' and paid_time<'" + date.AddDays(7).ToString("yyyy-MM-dd") + "'");
var objStockout = cn.QueryFirstOrDefault<int?>("select quantity_out_stock from dc_mid_transit where bailun_sku='"+item.bailun_sku+"' and warehouse_code='"+item.warehouse_code+"'");
var m = new Models.Warehouse.dc_mid_skuwarehouse_redundancy();
m.bailun_sku = item.bailun_sku;
m.bailun_sku_name = objsku.sku_title_cn;
m.warehouse_code = item.warehouse_code;
m.warehouse_name = objWarehouse.warehouse_name;
m.productcount = item.usable_stock;
m.amount_total = item.usable_stock * objsku.unit_price;
m.daily_productsale_count = obj7SaleAvg ?? 0;
m.dailysale_amount = (obj7SaleAvg ?? 0) * objsku.unit_price;
m.productsale_rate = item.usable_stock>0?(obj7SaleAvg ?? 0) / item.usable_stock*7:0;
m.saleamount_rate = item.usable_stock>0?(obj7SaleAvg ?? 0) / item.usable_stock*7:0;
m.redundancy_product_count = objRedundancy ?? 0;
m.redundancy_product_rate = item.usable_stock > 0 ? (objRedundancy ?? 0) / item.usable_stock : 0;
m.redundancy_amount = (objRedundancy ?? 0) * objsku.unit_price;
m.redundancy_amount_rate = item.usable_stock > 0 ? (objRedundancy ?? 0) / item.usable_stock : 0;
m.yesterdaysale_amount = (objYesterdaySale ?? 0) * objsku.unit_price;
m.yesterdaysale_count = (objYesterdaySale ?? 0);
m.sale_3d_avg = (obj3SaleAvg ?? 0)/3;
m.sale_7d_avg = (obj7SaleAvg ?? 0)/7;
m.sale_14d_avg = (obj14SaleAvg ?? 0)/14;
m.sale_30d_avg = (obj30SaleAvg ?? 0)/30;
m.day_turnover_rate = item.usable_stock>0?objYesterdaySale??0 / item.usable_stock:0;
m.week_turnover_rate = item.usable_stock > 0 ? (obj7SaleAvg ?? 0) / item.usable_stock * 7 : 0;
m.month_turnover_rate = item.usable_stock > 0 ? (obj30SaleAvg ?? 0) / item.usable_stock * 30 : 0;
m.stockout = objStockout ?? 0;
m.createtime = DateTime.Now;
m.day = DateTime.Now.AddDays(-1);
cn.Insert<Models.Warehouse.dc_mid_skuwarehouse_redundancy>(m);
}
}
return "";
}
}
}
......@@ -400,5 +400,8 @@ namespace Bailun.DC.Services
}
}
}
......@@ -304,5 +304,16 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
}
/// <summary>
/// 保存仓库冗余记录
/// </summary>
/// <returns></returns>
public string SkuWarehouseRedundancy()
{
var result = new Services.InventoryServices().SaveSkuWarehouseRedundancy();
return result;
}
}
}
\ No newline at end of file
......@@ -49,8 +49,9 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
amount_refund = (p.amount_refund*p.seller_order_exchange_rate).ToString("N2"),
amount_prepaid = p.amount_prepaid.ToString("N2"),
cost_promotion = (p.cost_promotion*p.seller_order_exchange_rate).ToString("N2"),
amount_shipping = (p.amount_shipping*p.seller_order_exchange_rate).ToString("N2"),
cost_platform_fee = (p.cost_platform_fee*p.seller_order_exchange_rate).ToString("N2"),
cost_platform_fee = (p.platform_type=="Ebay"?p.cost_platform_fee*p.seller_other_exchange_rate:p.cost_platform_fee*p.seller_order_exchange_rate).ToString("N2"),
cost_product = p.cost_product.ToString("N2"),
cost_package = p.cost_package.ToString("N2"),
cost_fba_fee = (p.cost_fba_fee*p.seller_order_exchange_rate).ToString("N2"),
......@@ -75,6 +76,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
amount_refund = (countM.amount_refund).ToString("N2"),
amount_prepaid = countM.amount_prepaid.ToString("N2"),
cost_promotion = (countM.cost_promotion).ToString("N2"),
amount_shipping = (countM.amount_shipping).ToString("N2"),
cost_platform_fee = (countM.cost_platform_fee).ToString("N2"),
cost_product = countM.cost_product.ToString("N2"),
......@@ -779,6 +781,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
countM.profit_total = Math.Round(countM.profit_total, 2, MidpointRounding.AwayFromZero);
countM.amount_prepaid = Math.Round(countM.amount_prepaid, 2, MidpointRounding.AwayFromZero);
countM.profit_rate = countM.amount_sales > 0 ? Math.Round((countM.profit_total / countM.amount_sales)*100,2,MidpointRounding.AwayFromZero) : 0;
countM.cost_logistics = Math.Round(countM.cost_logistics, 2, MidpointRounding.AwayFromZero);
var list = obj.Select(p => new
{
......@@ -817,7 +820,9 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
create_time = p.create_time.ToString("yyyy-MM-dd HH:mm:ss"),
paid_time = p.paid_time.ToString("yyyy-MM-dd HH:mm:ss"),
cost_logistics = p.cost_logistics.ToString("N2"),
});
return JsonConvert.SerializeObject(new { total=total,rows = list,count_row = countM});
......@@ -948,6 +953,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
countM.profit_rate = countM.amount_product>0?Math.Round((countM.profit_total / countM.amount_product), 2, MidpointRounding.AwayFromZero):0;
countM.cost_tail = Math.Round(countM.cost_tail, 2, MidpointRounding.AwayFromZero);
countM.cost_handle_bailun = Math.Round(countM.cost_handle_bailun, 2, MidpointRounding.AwayFromZero);
countM.cost_logistics = Math.Round(countM.cost_logistics, 2, MidpointRounding.AwayFromZero);
var obj = list.Select(p => new
{
......@@ -973,6 +979,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
cost_tail = p.cost_tail.ToString("N2"),
cost_handle_bailun = p.cost_handle_bailun.ToString("N2"),
noshippingcount = p.noshippingcount.ToString("N0"),
cost_logistics = p.cost_logistics.ToString("N2"),
});
return JsonConvert.SerializeObject(new
......@@ -1002,6 +1009,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
cost_tail = countM.cost_tail.ToString("N2"),
cost_handle_bailun = countM.cost_handle_bailun.ToString("N2"),
noshippingcount = countM.noshippingcount.ToString("N0"),
cost_logistics = countM.cost_logistics.ToString("N2"),
}
});
}
......@@ -1136,13 +1144,13 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="start">退款开始时间</param>
/// <param name="end">退款结束时间</param>
/// <returns></returns>
public string OrderRefundDetailsJson(BtTableParameter request, string platform, string website, string account, DateTime? start, DateTime? end)
public string OrderRefundDetailsJson(BtTableParameter request, string platform, string website, string account, DateTime? start, DateTime? end,string searchkey)
{
var total = 0;
var _services = new Services.OrdersServices();
var obj = _services.ListOrderRefund(request, platform, website, account, start, end, ref total);
var obj = _services.ListOrderRefund(request, platform, website, account, start, end, searchkey, ref total);
var countM = _services.ListOrderRefundCount(platform, website, account, start, end);
var countM = _services.ListOrderRefundCount(platform, website, account, start, end,searchkey);
var list = obj.Select(a => new {
a.platform_type,
......@@ -1164,12 +1172,12 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
return JsonConvert.SerializeObject(new { total=total,rows = list,count_row=new {
platform_type = "合计",
bailun_sku_quantity_refund = countM!=null?countM.bailun_sku_quantity_refund:0,
amount_refund_rmb = countM!=null?countM.amount_refund_rmb.ToString("N2"):"0"
amount_refund_rmb = countM!=null?countM.amount_refund_rmb.ToString("N2"):"0",
amount_refund = countM!=null?countM.amount_refund.ToString("N2"):"0"
}
});
}
#endregion
#region 预收款
......
......@@ -206,7 +206,7 @@
}
function ShowDetail(platform, website, account, coltitle, colval, single) {
//layer_show(platform + " " + website + " " + $('#start').val() + "至" + $('#end').val() + ' 订单明细', '@Url.Content("~/Reports/Orders/ListOrderDetail?platform=")' + platform + '&website=' + website + '&account=' + account + '&start=' + $('#start').val() + '&end=' + $('#end').val() + '&col=' + colval + '&coltitle=' + coltitle + '&showsingle=' + single, '90%', '90%');
layer_show(platform + " " + website + " " + $('#start').val() + "至" + $('#end').val() + ' 订单明细', '@Url.Content("~/Reports/Orders/ListOrderDetail?platform=")' + platform + '&website=' + website + '&account=' + account + '&start=' + $('#start').val() + '&end=' + $('#end').val() + '&col=' + colval + '&coltitle=' + coltitle + '&showsingle=' + single, '90%', '90%');
}
function listWarehouse() {
......
......@@ -135,9 +135,14 @@
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'头程费\',\'cost_first\',1)">' + data.cost_first + '</span>';
}
},
//{
// field: 'cost_tail', title: '尾程费', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
// return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'尾程费\',\'cost_tail\',1)">' + data.cost_tail + '</span>';
// }
//},
{
field: 'cost_tail', title: '尾程费', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'尾程费\',\'cost_tail\',1)">' + data.cost_tail + '</span>';
field: 'cost_logistics', title: '尾程费(估算)', width: '120', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'尾程费(估算)\',\'cost_logistics\',1)">' + data.cost_logistics + '</span>';
}
},
{
......
......@@ -51,7 +51,7 @@
</div>
</div>
@section css{
<link href="https://unpkg.com/bootstrap-table@1.14.2/dist/extensions/fixed-columns/bootstrap-table-fixed-columns.css" rel="stylesheet" />
<link href="~/css/bootstrap-table-fixed-columns.css" rel="stylesheet" />
<style>
.mules {
white-space: nowrap;
......@@ -61,7 +61,7 @@
</style>
}
@section scripts{
<script src="https://unpkg.com/bootstrap-table@1.14.2/dist/extensions/fixed-columns/bootstrap-table-fixed-columns.js" type="text/javascript"></script>
<script src="~/js/bootstrap-table-fixed-columns.js" type="text/javascript"></script>
<script type="text/javascript">
var tb;
$(document).ready(function () {
......
......@@ -36,7 +36,7 @@
</div>
<div class="form-group">
<label>&nbsp;</label>
<input id="orderno" name="orderno" class="form-control" type="text" style="width:150px" value="@(ViewBag.orderno)" placeholder="百伦订单号" />
<input id="orderno" name="orderno" class="form-control" type="text" style="width:180px" value="@(ViewBag.orderno)" placeholder="平台单号、百伦订单号" />
</div>
<div class="form-group">
<label>&nbsp;</label>
......@@ -51,6 +51,7 @@
</div>
</div>
@section css{
<link href="~/css/bootstrap-table-fixed-columns.css" rel="stylesheet" />
<style>
.mules {
white-space: nowrap;
......@@ -60,6 +61,7 @@
</style>
}
@section scripts{
<script src="~/js/bootstrap-table-fixed-columns.js" type="text/javascript"></script>
<script type="text/javascript">
var tb;
$(document).ready(function () {
......@@ -110,10 +112,10 @@
{ field: 'cost_handle_bailun', title: '处理费(百伦)', width: '130', sortable: true, iscount: true },
{ field: 'cost_handle_platform', title: '平台操作费', width: '130', sortable: true, iscount: true },
{ field: 'cost_first', title: '头程费', width: '100', sortable: true, iscount: true },
{ field: 'cost_tail', title: '尾程费', width: '100', sortable: true, iscount: true },
{ field: 'cost_logistics', title: '尾程费(估算)', width: '120', sortable: true, iscount: true },
{ field: 'profit_total', title: '利润', width: '100', sortable: true, iscount: true },
{ field: 'profit_rate', title: '利润率', width: '100', sortable: true, iscount: true },
{ field: 'amount_prepaid', title: '预收款', width: '100', sortable: true,iscount: true },
{ field: 'amount_prepaid', title: '预收款', width: '100', sortable: true,iscount: true },
{ field: 'create_time', title: '下单时间', width: '150', sortable: true },
{ field: 'paid_time', title: '付款时间', width: '150', sortable: true }
];
......@@ -142,7 +144,10 @@
if (tb == undefined) {
tb = OnlyTable("roletable", (@ViewBag.showsingle== 1 ? columns_single : columns), url, "", {
showfooter: true, showCount: true
});
}, {
fixedcol: true,
fixedcolnum: 2
});
}
else {
tb.bootstrapTable('refresh', { url: url });
......
......@@ -73,7 +73,7 @@
listWebsite();
//listWarehouse();
})
function list() {
......@@ -95,6 +95,7 @@
@if (ViewBag.platform == "FBA")
{
@Html.Raw("{ field: 'cost_fba_fee', title: 'FBA费用', width: '100', sortable: true, iscount: true },")
@Html.Raw("{ field: 'amount_shipping', title: '运费收入', width: '110', sortable: true, iscount: true },")
}
@if (ViewBag.platform == "FBA" || ViewBag.platform == "Amazon")
{
......@@ -108,9 +109,9 @@
{
@Html.Raw("{ field: 'cost_tail', title: '尾程费', width: '120', sortable: true, iscount: true },{ field: 'cost_handle_bailun', title: '第三方仓处理费', width: '160', sortable: true, iscount: true},")
}
//{ field: 'cost_refund_commisson', title: '退款佣金', width: '120', sortable: true, iscount: true },
//{ field: 'cost_handle_platform', title: '操作费', width: '120', sortable: true, iscount: true },
{ field: 'cost_product', title: '产品成本', width: '100', sortable: true, iscount: true },
{ field: 'cost_first', title: '头程费', width: '120', sortable: true, iscount: true },
......@@ -166,7 +167,7 @@
function ShowDetail(platform, website, account, coltitle, colval, single) {
layer_show(platform + " " + website + " " + $('#start').val() + "至" + $('#end').val() + ' 订单明细', '@Url.Content("~/Reports/Orders/ListOrderDetail?platform=")' + platform + '&website=' + website + '&account=' + account + '&start=' + $('#start').val() + '&end=' + $('#end').val() + '&col=' + colval + '&coltitle=' + coltitle + '&showsingle=' + single, '90%', '90%');
}
</script>
......
......@@ -36,6 +36,10 @@
</div>
<div class="form-group">
<label>&nbsp;</label>
<input id="searchkey" name="searchkey" class="form-control" style="width:160px" placeholder="平台订单号" />
</div>
<div class="form-group">
<label>&nbsp;</label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i>&nbsp;查询</button>
</div>
</div>
......@@ -73,6 +77,16 @@
listAccount();
listWebsite();
$('#platform').change(function () {
listWebsite();
listAccount();
})
$('#website').change(function () {
listAccount();
})
})
function list() {
......@@ -101,7 +115,7 @@
}
},
{ field: 'order_currency', title: '币种', width: '80', sortable: true, iscount: false },
{ field: 'amount_refund', title: '退款金额原币', width: '130', sortable: true, iscount: false },
{ field: 'amount_refund', title: '退款金额原币', width: '130', sortable: true, iscount: true },
{ field: 'amount_refund_rmb', title: '退款金额RMB', width: '130', sortable: true, iscount: true },
{ field: 'bailun_sku_quantity_refund', title: '退货数量', width: '110', sortable: true, iscount: true },
{ field: 'bailun_sku_unit_price', title: 'Sku采购价', width: '120', sortable: true, iscount: false },
......
......@@ -18,8 +18,8 @@
<link href="/css/hplus/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
<link href="/css/hplus/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
@*<link href="/css/hplus/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />*@
<link href="~/js/boostrap-table/bootstrap-table.min.css" rel="stylesheet" />
<link href="/css/hplus/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
@*<link href="~/js/boostrap-table/bootstrap-table.min.css" rel="stylesheet" />*@
<link href="/css/hplus/css/animate.min.css" rel="stylesheet">
<link href="/css/Layer-2.1/skin/layer.css" rel="stylesheet" />
<!--showloading-->
......@@ -64,8 +64,8 @@
<script src="/css/hplus/js/content.min.js"></script><!--右上侧显示首页图标-->
<script src="/css/hplus/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="~/js/boostrap-table/bootstrap-table.min.js"></script>
@*<script src="/css/hplus/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>*@
@*<script src="~/js/boostrap-table/bootstrap-table.min.js"></script>*@
<script src="/css/hplus/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/css/hplus/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/css/hplus/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="/css/hplus/js/plugins/showloading/jquery.showLoading.min.js"></script>
......
.fixed-table-header-columns,
.fixed-table-body-columns {
position: absolute;
background-color: #fff;
display: none;
box-sizing: border-box;
overflow: hidden;
}
.fixed-table-header-columns .table,
.fixed-table-body-columns .table {
border-right: 1px solid #ddd;
}
.fixed-table-header-columns .table.table-no-bordered,
.fixed-table-body-columns .table.table-no-bordered {
border-right: 1px solid transparent;
}
.fixed-table-body-columns table {
position: absolute;
animation: none;
}
.bootstrap-table .table-hover > tbody > tr.hover > td {
background-color: #f5f5f5;
}
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* @version: v1.0.1
*/
(function ($) {
'use strict';
$.extend($.fn.bootstrapTable.defaults, {
fixedColumns: false,
fixedNumber: 1
});
var BootstrapTable = $.fn.bootstrapTable.Constructor,
_initHeader = BootstrapTable.prototype.initHeader,
_initBody = BootstrapTable.prototype.initBody,
_resetView = BootstrapTable.prototype.resetView;
BootstrapTable.prototype.initFixedColumns = function () {
this.$fixedHeader = $([
'<div class="fixed-table-header-columns">',
'<table>',
'<thead></thead>',
'</table>',
'</div>'].join(''));
this.timeoutHeaderColumns_ = 0;
this.$fixedHeader.find('table').attr('class', this.$el.attr('class'));
this.$fixedHeaderColumns = this.$fixedHeader.find('thead');
this.$tableHeader.before(this.$fixedHeader);
this.$fixedBody = $([
'<div class="fixed-table-body-columns">',
'<table>',
'<tbody></tbody>',
'</table>',
'</div>'].join(''));
this.timeoutBodyColumns_ = 0;
this.$fixedBody.find('table').attr('class', this.$el.attr('class'));
this.$fixedBodyColumns = this.$fixedBody.find('tbody');
this.$tableBody.before(this.$fixedBody);
};
BootstrapTable.prototype.initHeader = function () {
_initHeader.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.fixedColumns) {
return;
}
this.initFixedColumns();
var that = this, $trs = this.$header.find('tr').clone();
$trs.each(function () {
$(this).find('th:gt(' + that.options.fixedNumber + ')').remove();
});
this.$fixedHeaderColumns.html('').append($trs);
};
BootstrapTable.prototype.initBody = function () {
_initBody.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.fixedColumns) {
return;
}
var that = this,
rowspan = 0;
this.$fixedBodyColumns.html('');
this.$body.find('> tr[data-index]').each(function () {
var $tr = $(this).clone(),
$tds = $tr.find('td');
$tr.html('');
var end = that.options.fixedNumber;
if (rowspan > 0) {
--end;
--rowspan;
}
for (var i = 0; i < end; i++) {
$tr.append($tds.eq(i).clone());
}
that.$fixedBodyColumns.append($tr);
if ($tds.eq(0).attr('rowspan')) {
rowspan = $tds.eq(0).attr('rowspan') - 1;
}
});
};
BootstrapTable.prototype.resetView = function () {
_resetView.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.fixedColumns) {
return;
}
clearTimeout(this.timeoutHeaderColumns_);
this.timeoutHeaderColumns_ = setTimeout($.proxy(this.fitHeaderColumns, this), this.$el.is(':hidden') ? 100 : 0);
clearTimeout(this.timeoutBodyColumns_);
this.timeoutBodyColumns_ = setTimeout($.proxy(this.fitBodyColumns, this), this.$el.is(':hidden') ? 100 : 0);
};
BootstrapTable.prototype.fitHeaderColumns = function () {
var that = this,
visibleFields = this.getVisibleFields(),
headerWidth = 0;
this.$body.find('tr:first-child:not(.no-records-found) > *').each(function (i) {
var $this = $(this),
index = i;
if (i >= that.options.fixedNumber) {
return false;
}
if (that.options.detailView && !that.options.cardView) {
index = i - 1;
}
that.$fixedHeader.find('th[data-field="' + visibleFields[index] + '"]')
.find('.fht-cell').width($this.innerWidth());
headerWidth += $this.outerWidth();
});
this.$fixedHeader.width(headerWidth + 1).show();
};
BootstrapTable.prototype.fitBodyColumns = function () {
var that = this,
top = -(parseInt(this.$el.css('margin-top')) - 2),
// the fixed height should reduce the scorll-x height
height = this.$tableBody.height() - 14;
if (!this.$body.find('> tr[data-index]').length) {
this.$fixedBody.hide();
return;
}
if (!this.options.height) {
top = this.$fixedHeader.height();
height = height - top;
}
this.$fixedBody.css({
width: this.$fixedHeader.width(),
height: height,
top: top
}).show();
this.$body.find('> tr').each(function (i) {
that.$fixedBody.find('tr:eq(' + i + ')').height($(this).height() - 1);
});
// events
this.$tableBody.on('scroll', function () {
that.$fixedBody.find('table').css('top', -$(this).scrollTop());
});
this.$body.find('> tr[data-index]').off('hover').hover(function () {
var index = $(this).data('index');
that.$fixedBody.find('tr[data-index="' + index + '"]').addClass('hover');
}, function () {
var index = $(this).data('index');
that.$fixedBody.find('tr[data-index="' + index + '"]').removeClass('hover');
});
this.$fixedBody.find('tr[data-index]').off('hover').hover(function () {
var index = $(this).data('index');
that.$body.find('tr[data-index="' + index + '"]').addClass('hover');
}, function () {
var index = $(this).data('index');
that.$body.find('> tr[data-index="' + index + '"]').removeClass('hover');
});
};
})(jQuery);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment