Commit aa6f7c90 by guanzhenshan

新月销售利润报表增加修改说明,明细的功能

parent dd0e53eb
......@@ -83,6 +83,10 @@ namespace Bailun.DC.Models
/// 是否已删除 1:已删除,0:未删除
/// </summary>
public int delstatus { get; set; }
/// <summary>
/// 是否新销售利润报表的明细,1:是,0:否(旧的)
/// </summary>
public int? isnew { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models
{
public class dc_month_sales_profit_description
{
/// <summary>
///
/// </summary>
public int id { get; set; }
/// <summary>
/// 月份
/// </summary>
public string month { get; set; }
/// <summary>
/// 总销售额
/// </summary>
public string amount_sales { get; set; }
/// <summary>
/// 销售额-精油
/// </summary>
public string amount_sales_jingyou { get; set; }
/// <summary>
/// 销售额-电子
/// </summary>
public string amount_sales_dianzi { get; set; }
/// <summary>
/// 销售额-家居产品
/// </summary>
public string amount_sales_jiaju { get; set; }
/// <summary>
/// 销售额-美容美甲产品
/// </summary>
public string amount_sales_meirongmj { get; set; }
/// <summary>
/// 销售额-服装
/// </summary>
public string amount_sales_fuzhuang { get; set; }
/// <summary>
/// 销售额-其他
/// </summary>
public string amount_sales_other { get; set; }
/// <summary>
/// 总成本
/// </summary>
public string cost { get; set; }
/// <summary>
/// 精油成本
/// </summary>
public string cost_jingyou { get; set; }
/// <summary>
/// 电子成本
/// </summary>
public string cost_dianzi { get; set; }
/// <summary>
/// 家居成本
/// </summary>
public string cost_jiaju { get; set; }
/// <summary>
/// 美容美甲产品成本
/// </summary>
public string cost_meirongmj { get; set; }
/// <summary>
/// 服装成本
/// </summary>
public string cost_fuzhuang { get; set; }
/// <summary>
/// 成本-其他产品类型
/// </summary>
public string cost_other { get; set; }
/// <summary>
/// 平台扣费及退款
/// </summary>
public string fee_platform_and_refund { get; set; }
/// <summary>
/// 平台费
/// </summary>
public string fee_platform { get; set; }
/// <summary>
/// FBA费
/// </summary>
public string fee_fba { get; set; }
/// <summary>
/// 平台退款
/// </summary>
public string fee_refund { get; set; }
/// <summary>
/// 广告及宣传费用
/// </summary>
public string fee_ad { get; set; }
/// <summary>
/// 平台提现回款
/// </summary>
public string amount_withdraw { get; set; }
/// <summary>
/// 物流仓储费用
/// </summary>
public string fee_logistics_storage { get; set; }
/// <summary>
/// 头程费
/// </summary>
public string fee_logistics_first { get; set; }
/// <summary>
/// 直邮物流费
/// </summary>
public string fee_logistics_direct { get; set; }
/// <summary>
/// 尾程费
/// </summary>
public string fee_logistics_tail { get; set; }
/// <summary>
/// 海外仓仓储
/// </summary>
public string fee_storage { get; set; }
/// <summary>
/// 海外仓其他杂费
/// </summary>
public string fee_storage_incidentals { get; set; }
/// <summary>
/// 付现销售费用
/// </summary>
public string fee_paycash_sales { get; set; }
/// <summary>
/// 销售费用合计
/// </summary>
public string fee_sales_count { get; set; }
/// <summary>
/// 销售利润
/// </summary>
public string profit_sales { get; set; }
/// <summary>
/// 销售毛利率
/// </summary>
public string rate_profit_sales { get; set; }
/// <summary>
/// 管理成本-香港百伦
/// </summary>
public string managecost_bl_xg { get; set; }
/// <summary>
/// 管理成本-广州百伦
/// </summary>
public string managecost_bl_gz { get; set; }
/// <summary>
/// 管理成本-美容美甲店 歌戈尔
/// </summary>
public string managecost_meijia { get; set; }
/// <summary>
/// 管理成本-杨杉
/// </summary>
public string managercost_yangshan { get; set; }
/// <summary>
/// 管理成本-成品仓
/// </summary>
public string managercost_chengpincang { get; set; }
/// <summary>
/// 管理成本-信荟蓝
/// </summary>
public string managercost_xinhuilan { get; set; }
/// <summary>
/// 管理成本-迪致美容
/// </summary>
public string managercost_dizhi { get; set; }
/// <summary>
/// 管理成本-广州美甲生产仓
/// </summary>
public string managercost_meijiashengchan { get; set; }
/// <summary>
/// 管理成本合计
/// </summary>
public string managercost_count { get; set; }
/// <summary>
/// 财务费用
/// </summary>
public string fee_finance { get; set; }
/// <summary>
/// 营业利润
/// </summary>
public string profit { get; set; }
/// <summary>
/// 营业毛利率
/// </summary>
public string rate_profit { get; set; }
/// <summary>
/// 加:其他收入
/// </summary>
public string incoming_other { get; set; }
/// <summary>
/// 出口退税收入
/// </summary>
public string incoming_refundtax { get; set; }
/// <summary>
/// 加:营业外收入
/// </summary>
public string incoming_non_operating { get; set; }
/// <summary>
/// 减:营业外支出
/// </summary>
public string pay_non_operating { get; set; }
/// <summary>
/// 实际利润
/// </summary>
public string actual_profit { get; set; }
/// <summary>
/// 减:分红
/// </summary>
public string dividend { get; set; }
/// <summary>
/// 利润结余
/// </summary>
public string profit_balance { get; set; }
/// <summary>
/// 净利润率
/// </summary>
public string rate_profit_actual { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime createtime { get; set; }
/// <summary>
/// 更新人
/// </summary>
public int lastupdateuserid { get; set; }
/// <summary>
///
/// </summary>
public string lastupdateusername { get; set; }
/// <summary>
///
/// </summary>
public DateTime lastupdatetime { get; set; }
/// <summary>
/// 减:资产减值损失
/// </summary>
public string impairment_assets { get; set; }
}
public class mMonthSalesProfitDesc_Input
{
/// <summary>
/// 月份
/// </summary>
public string month { get; set; }
/// <summary>
/// 总销售额
/// </summary>
public string amount_sales { get; set; }
/// <summary>
/// 销售额-精油
/// </summary>
public string amount_sales_jingyou { get; set; }
/// <summary>
/// 销售额-电子
/// </summary>
public string amount_sales_dianzi { get; set; }
/// <summary>
/// 销售额-家居产品
/// </summary>
public string amount_sales_jiaju { get; set; }
/// <summary>
/// 销售额-美容美甲产品
/// </summary>
public string amount_sales_meirongmj { get; set; }
/// <summary>
/// 销售额-服装
/// </summary>
public string amount_sales_fuzhuang { get; set; }
/// <summary>
/// 销售额-其他
/// </summary>
public string amount_sales_other { get; set; }
/// <summary>
/// 总成本
/// </summary>
public string cost { get; set; }
/// <summary>
/// 精油成本
/// </summary>
public string cost_jingyou { get; set; }
/// <summary>
/// 电子成本
/// </summary>
public string cost_dianzi { get; set; }
/// <summary>
/// 家居成本
/// </summary>
public string cost_jiaju { get; set; }
/// <summary>
/// 美容美甲产品成本
/// </summary>
public string cost_meirongmj { get; set; }
/// <summary>
/// 服装成本
/// </summary>
public string cost_fuzhuang { get; set; }
/// <summary>
/// 成本-其他产品类型
/// </summary>
public string cost_other { get; set; }
/// <summary>
/// 平台扣费及退款
/// </summary>
public string fee_platform_and_refund { get; set; }
/// <summary>
/// 平台费
/// </summary>
public string fee_platform { get; set; }
/// <summary>
/// FBA费
/// </summary>
public string fee_fba { get; set; }
/// <summary>
/// 平台退款
/// </summary>
public string fee_refund { get; set; }
/// <summary>
/// 广告及宣传费用
/// </summary>
public string fee_ad { get; set; }
/// <summary>
/// 平台提现回款
/// </summary>
public string amount_withdraw { get; set; }
/// <summary>
/// 物流仓储费用
/// </summary>
public string fee_logistics_storage { get; set; }
/// <summary>
/// 头程费
/// </summary>
public string fee_logistics_first { get; set; }
/// <summary>
/// 直邮物流费
/// </summary>
public string fee_logistics_direct { get; set; }
/// <summary>
/// 尾程费
/// </summary>
public string fee_logistics_tail { get; set; }
/// <summary>
/// 海外仓仓储
/// </summary>
public string fee_storage { get; set; }
/// <summary>
/// 海外仓其他杂费
/// </summary>
public string fee_storage_incidentals { get; set; }
/// <summary>
/// 付现销售费用
/// </summary>
public string fee_paycash_sales { get; set; }
/// <summary>
/// 销售费用合计
/// </summary>
public string fee_sales_count { get; set; }
/// <summary>
/// 销售利润
/// </summary>
public string profit_sales { get; set; }
/// <summary>
/// 销售毛利率
/// </summary>
public string rate_profit_sales { get; set; }
/// <summary>
/// 管理成本-香港百伦
/// </summary>
public string managecost_bl_xg { get; set; }
/// <summary>
/// 管理成本-广州百伦
/// </summary>
public string managecost_bl_gz { get; set; }
/// <summary>
/// 管理成本-美容美甲店 歌戈尔
/// </summary>
public string managecost_meijia { get; set; }
/// <summary>
/// 管理成本-杨杉
/// </summary>
public string managercost_yangshan { get; set; }
/// <summary>
/// 管理成本-成品仓
/// </summary>
public string managercost_chengpincang { get; set; }
/// <summary>
/// 管理成本-信荟蓝
/// </summary>
public string managercost_xinhuilan { get; set; }
/// <summary>
/// 管理成本-迪致美容
/// </summary>
public string managercost_dizhi { get; set; }
/// <summary>
/// 管理成本-广州美甲生产仓
/// </summary>
public string managercost_meijiashengchan { get; set; }
/// <summary>
/// 管理成本合计
/// </summary>
public string managercost_count { get; set; }
/// <summary>
/// 财务费用
/// </summary>
public string fee_finance { get; set; }
/// <summary>
/// 营业利润
/// </summary>
public string profit { get; set; }
/// <summary>
/// 营业毛利率
/// </summary>
public string rate_profit { get; set; }
/// <summary>
/// 加:其他收入
/// </summary>
public string incoming_other { get; set; }
/// <summary>
/// 出口退税收入
/// </summary>
public string incoming_refundtax { get; set; }
/// <summary>
/// 加:营业外收入
/// </summary>
public string incoming_non_operating { get; set; }
/// <summary>
/// 减:营业外支出
/// </summary>
public string pay_non_operating { get; set; }
/// <summary>
/// 实际利润
/// </summary>
public string actual_profit { get; set; }
/// <summary>
/// 减:分红
/// </summary>
public string dividend { get; set; }
/// <summary>
/// 利润结余
/// </summary>
public string profit_balance { get; set; }
/// <summary>
/// 净利润率
/// </summary>
public string rate_profit_actual { get; set; }
/// <summary>
/// 减:资产减值损失
/// </summary>
public string impairment_assets { get; set; }
}
}
......@@ -5910,6 +5910,365 @@ group by currency";
}
/// <summary>
/// 新月度利润报表 数据说明
/// </summary>
/// <param name="start">开始月份</param>
/// <param name="end">结束月份</param>
/// <returns></returns>
public List<dc_month_sales_profit_description> ListMonthSaleProfitNewDescription(string start, string end)
{
var sql = $"select * from dc_month_sales_profit_description where month>='{start}' ";
if (!string.IsNullOrEmpty(end))
{
sql += (" and month<='" + end + "'");
}
sql += " order by month desc limit 6";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == ConnectionState.Closed)
{
if (cn.State == ConnectionState.Closed)
{
cn.Open();
}
}
var obj = cn.Query<dc_month_sales_profit_description>(sql, null, null, true, 2 * 60);
return obj.ToList();
}
}
/// <summary>
/// 更新新月销售利润数据描述
/// </summary>
/// <param name="m"></param>
/// <param name="uid"></param>
/// <param name="username"></param>
/// <returns></returns>
public string SaveMonthSaleProfitNewDescription(mMonthSalesProfitDesc_Input m, int uid, string username)
{
var sql = $"select * from dc_month_sales_profit_description where month='{m.month}'";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == ConnectionState.Closed)
{
cn.Open();
}
var obj = cn.QueryFirstOrDefault<dc_month_sales_profit_description>(sql);
if (obj == null)
{
obj = new dc_month_sales_profit_description
{
month = m.month,
createtime = DateTime.Now,
actual_profit = "",
amount_sales = "",
amount_sales_dianzi = "",
amount_sales_fuzhuang="",
amount_sales_jiaju="",
amount_sales_jingyou="",
amount_sales_meirongmj="",
amount_sales_other="",
amount_withdraw="",
fee_ad = "",
fee_fba = "",
fee_finance = "",
fee_logistics_direct = "",
fee_logistics_first = "",
fee_logistics_storage="",
fee_logistics_tail="",
fee_paycash_sales = "",
fee_platform = "",
fee_platform_and_refund="",
fee_refund = "",
fee_sales_count = "",
fee_storage = "",
fee_storage_incidentals = "",
cost = "",
cost_fuzhuang = "",
cost_dianzi = "",
cost_jiaju = "",
cost_jingyou = "",
cost_meirongmj = "",
cost_other = "",
managercost_chengpincang = "",
managecost_bl_gz = "",
managecost_bl_xg = "",
managecost_meijia = "",
managercost_count = "",
managercost_dizhi = "",
managercost_meijiashengchan = "",
managercost_xinhuilan = "",
managercost_yangshan = "",
pay_non_operating = "",
profit = "",
profit_balance = "",
profit_sales = "",
rate_profit = "",
rate_profit_actual = "",
rate_profit_sales = "",
impairment_assets = "",
incoming_non_operating = "",
incoming_other = "",
incoming_refundtax = "",
dividend = "",
};
}
#region 赋值
if (obj.actual_profit != m.actual_profit && m.actual_profit != null)
{
obj.actual_profit = m.actual_profit;
}
else if(obj.actual_profit != m.actual_profit && m.actual_profit != null)
{
obj.actual_profit = m.actual_profit;
}
else if (obj.amount_sales != m.amount_sales && m.amount_sales != null)
{
obj.amount_sales = m.amount_sales;
}
else if (obj.amount_sales_dianzi != m.amount_sales_dianzi && m.amount_sales_dianzi != null)
{
obj.amount_sales_dianzi = m.amount_sales_dianzi;
}
else if (obj.amount_sales_fuzhuang != m.amount_sales_fuzhuang && m.amount_sales_fuzhuang != null)
{
obj.amount_sales_fuzhuang = m.amount_sales_fuzhuang;
}
else if (obj.amount_sales_jiaju != m.amount_sales_jiaju && m.amount_sales_jiaju != null)
{
obj.amount_sales_jiaju = m.amount_sales_jiaju;
}
else if (obj.amount_sales_jingyou != m.amount_sales_jingyou && m.amount_sales_jingyou != null)
{
obj.amount_sales_jingyou = m.amount_sales_jingyou;
}
else if (obj.amount_sales_meirongmj != m.amount_sales_meirongmj && m.amount_sales_meirongmj != null)
{
obj.amount_sales_meirongmj = m.amount_sales_meirongmj;
}
else if (obj.amount_sales_other != m.amount_sales_other && m.amount_sales_other != null)
{
obj.amount_sales_other = m.amount_sales_other;
}
else if (obj.amount_withdraw != m.amount_withdraw && m.amount_withdraw != null)
{
obj.amount_withdraw = m.amount_withdraw;
}
else if (obj.fee_ad != m.fee_ad && m.fee_ad != null)
{
obj.fee_ad = m.fee_ad;
}
else if (obj.fee_fba != m.fee_fba && m.fee_fba != null)
{
obj.fee_fba = m.fee_fba;
}
else if (obj.fee_finance != m.fee_finance && m.fee_finance != null)
{
obj.fee_finance = m.fee_finance;
}
else if (obj.fee_logistics_direct != m.fee_logistics_direct && m.fee_logistics_direct != null)
{
obj.fee_logistics_direct = m.fee_logistics_direct;
}
else if (obj.fee_logistics_first != m.fee_logistics_first && m.fee_logistics_first != null)
{
obj.fee_logistics_first = m.fee_logistics_first;
}
else if (obj.fee_logistics_storage != m.fee_logistics_storage && m.fee_logistics_storage != null)
{
obj.fee_logistics_storage = m.fee_logistics_storage;
}
else if (obj.fee_logistics_tail != m.fee_logistics_tail && m.fee_logistics_tail != null)
{
obj.fee_logistics_tail = m.fee_logistics_tail;
}
else if (obj.fee_paycash_sales != m.fee_paycash_sales && m.fee_paycash_sales != null)
{
obj.fee_paycash_sales = m.fee_paycash_sales;
}
else if (obj.fee_platform != m.fee_platform && m.fee_platform != null)
{
obj.fee_platform = m.fee_platform;
}
else if (obj.fee_platform_and_refund != m.fee_platform_and_refund && m.fee_platform_and_refund != null)
{
obj.fee_platform_and_refund = m.fee_platform_and_refund;
}
else if (obj.fee_refund != m.fee_refund && m.fee_refund != null)
{
obj.fee_refund = m.fee_refund;
}
else if (obj.fee_sales_count != m.fee_sales_count && m.fee_sales_count != null)
{
obj.fee_sales_count = m.fee_sales_count;
}
else if (obj.fee_storage != m.fee_storage && m.fee_storage != null)
{
obj.fee_storage = m.fee_storage;
}
else if (obj.fee_storage_incidentals != m.fee_storage_incidentals && m.fee_storage_incidentals != null)
{
obj.fee_storage_incidentals = m.fee_storage_incidentals;
}
else if (obj.cost != m.cost && m.cost != null)
{
obj.cost = m.cost;
}
else if (obj.cost_fuzhuang != m.cost_fuzhuang && m.cost_fuzhuang != null)
{
obj.cost_fuzhuang = m.cost_fuzhuang;
}
else if (obj.cost_dianzi != m.cost_dianzi && m.cost_dianzi != null)
{
obj.cost_dianzi = m.cost_dianzi;
}
else if (obj.cost_jiaju != m.cost_jiaju && m.cost_jiaju != null)
{
obj.cost_jiaju = m.cost_jiaju;
}
else if (obj.cost_jingyou != m.cost_jingyou && m.cost_jingyou != null)
{
obj.cost_jingyou = m.cost_jingyou;
}
else if (obj.cost_meirongmj != m.cost_meirongmj && m.cost_meirongmj != null)
{
obj.cost_meirongmj = m.cost_meirongmj;
}
else if (obj.cost_other != m.cost_other && m.cost_other != null)
{
obj.cost_other = m.cost_other;
}
else if (obj.managercost_chengpincang != m.managercost_chengpincang && m.managercost_chengpincang != null)
{
obj.managercost_chengpincang = m.managercost_chengpincang;
}
else if (obj.managecost_bl_gz != m.managecost_bl_gz && m.managecost_bl_gz != null)
{
obj.managecost_bl_gz = m.managecost_bl_gz;
}
else if (obj.managecost_bl_xg != m.managecost_bl_xg && m.managecost_bl_xg != null)
{
obj.managecost_bl_xg = m.managecost_bl_xg;
}
else if (obj.managecost_meijia != m.managecost_meijia && m.managecost_meijia != null)
{
obj.managecost_meijia = m.managecost_meijia;
}
else if (obj.managercost_count != m.managercost_count && m.managercost_count != null)
{
obj.managercost_count = m.managercost_count;
}
else if (obj.managercost_dizhi != m.managercost_dizhi && m.managercost_dizhi != null)
{
obj.managercost_dizhi = m.managercost_dizhi;
}
else if (obj.managercost_meijiashengchan != m.managercost_meijiashengchan && m.managercost_meijiashengchan != null)
{
obj.managercost_meijiashengchan = m.managercost_meijiashengchan;
}
else if (obj.managercost_xinhuilan != m.managercost_xinhuilan && m.managercost_xinhuilan != null)
{
obj.managercost_xinhuilan = m.managercost_xinhuilan;
}
else if (obj.managercost_yangshan != m.managercost_yangshan && m.managercost_yangshan != null)
{
obj.managercost_yangshan = m.managercost_yangshan;
}
else if (obj.pay_non_operating != m.pay_non_operating && m.pay_non_operating != null)
{
obj.pay_non_operating = m.pay_non_operating;
}
else if (obj.profit != m.profit && m.profit != null)
{
obj.profit = m.profit;
}
else if (obj.profit_balance != m.profit_balance && m.profit_balance != null)
{
obj.profit_balance = m.profit_balance;
}
else if (obj.profit_sales != m.profit_sales && m.profit_sales != null)
{
obj.profit_sales = m.profit_sales;
}
else if (obj.rate_profit != m.rate_profit && m.rate_profit != null)
{
obj.rate_profit = m.rate_profit;
}
else if (obj.rate_profit_actual != m.rate_profit_actual && m.rate_profit_actual != null)
{
obj.rate_profit_actual = m.rate_profit_actual;
}
else if (obj.rate_profit_sales != m.rate_profit_sales && m.rate_profit_sales != null)
{
obj.rate_profit_sales = m.rate_profit_sales;
}
else if (obj.impairment_assets != m.impairment_assets && m.impairment_assets != null)
{
obj.impairment_assets = m.impairment_assets;
}
else if (obj.incoming_non_operating != m.incoming_non_operating && m.incoming_non_operating != null)
{
obj.incoming_non_operating = m.incoming_non_operating;
}
else if (obj.incoming_other != m.incoming_other && m.incoming_other != null)
{
obj.incoming_other = m.incoming_other;
}
else if (obj.incoming_refundtax != m.incoming_refundtax && m.incoming_refundtax != null)
{
obj.incoming_refundtax = m.incoming_refundtax;
}
else if (obj.dividend != m.dividend && m.dividend != null)
{
obj.dividend = m.dividend;
}
#endregion
obj.lastupdatetime = DateTime.Now;
obj.lastupdateuserid = uid;
obj.lastupdateusername = username;
try
{
if (obj.id > 0)
{
cn.Update<dc_month_sales_profit_description>(obj);
}
else
{
cn.Insert<dc_month_sales_profit_description>(obj);
}
return "";
}
catch (Exception ex)
{
return ex.Message;
}
}
}
/// <summary>
/// 获取月销售利润明细
/// </summary>
/// <param name="parameter">分页信息</param>
......@@ -5917,9 +6276,9 @@ group by currency";
/// <param name="colval">列名</param>
/// <param name="total">符合条件的记录数</param>
/// <returns></returns>
public List<dc_month_sale_profit_details> ListMonthSaleProfitDetail(BtTableParameter parameter, string month, string colval, ref int total)
public List<dc_month_sale_profit_details> ListMonthSaleProfitDetail(BtTableParameter parameter, string month, string colval, ref int total,int isnew=0)
{
var sql = "select * from dc_month_sale_profit_details where delstatus=0 ";
var sql = "select * from dc_month_sale_profit_details where delstatus=0 and isnew="+isnew+" ";
var sqlparam = new DynamicParameters();
if (!string.IsNullOrEmpty(month))
......@@ -5934,6 +6293,7 @@ group by currency";
sqlparam.Add("val", colval);
}
if (!string.IsNullOrEmpty(parameter.sort))
{
sql += " order by " + parameter.sort + " " + parameter.order;
......@@ -5960,9 +6320,9 @@ group by currency";
/// <param name="month">月份</param>
/// <param name="colval">列名</param>
/// <returns></returns>
public dc_month_sale_profit_details ListMonthSaleProfitDetailCount(string month, string colval)
public dc_month_sale_profit_details ListMonthSaleProfitDetailCount(string month, string colval, int isnew = 0)
{
var sql = "select sum(amount) amount from dc_month_sale_profit_details where delstatus=0 ";
var sql = "select sum(amount) amount from dc_month_sale_profit_details where delstatus=0 and isnew=" + isnew + " ";
var sqlparam = new DynamicParameters();
if (!string.IsNullOrEmpty(month))
......
......@@ -8757,12 +8757,14 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// 月销售利润明细
/// </summary>
/// <returns></returns>
public ActionResult MonthSaleProfitDetails(string month,string col,string colname)
public ActionResult MonthSaleProfitDetails(string month,string col,string colname,int? isnew)
{
ViewBag.month = month;
ViewBag.col = col;
ViewBag.colname = colname;
ViewBag.isnew = (isnew ?? 0);
return View();
}
......@@ -8774,14 +8776,14 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="col">列名</param>
/// <returns></returns>
[BailunAuthentication(LoginMode.Enforce)]
public string ListMonthSaleProfitDetailJson(BtTableParameter parameter, string month, string col)
public string ListMonthSaleProfitDetailJson(BtTableParameter parameter, string month, string col,int? isnew)
{
var user = HttpContextHelper.Current?.User;
var total = 0;
var _service = new Services.FinanceReportServices();
var obj = _service.ListMonthSaleProfitDetail(parameter, month, col, ref total);
var objCount = _service.ListMonthSaleProfitDetailCount(month, col);
var obj = _service.ListMonthSaleProfitDetail(parameter, month, col, ref total,(isnew??0));
var objCount = _service.ListMonthSaleProfitDetailCount(month, col, (isnew ?? 0));
var list = obj.Select(a => new {
a.id,
......@@ -8818,7 +8820,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="uid"></param>
/// <param name="username"></param>
/// <returns></returns>
public JsonResult UploadMonthSaleProfitDetail(string month,string col,string colname,int uid,string username)
public JsonResult UploadMonthSaleProfitDetail(string month,string col,string colname,int uid,string username, int? isnew)
{
if (Request.Form.Files.Count == 0)
{
......@@ -8859,7 +8861,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
month = month,
colval = col,
colname = colname
colname = colname,
isnew = (isnew??0)
});
}
}
......@@ -8971,7 +8974,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
try
{
var obj = _service.ListMonthSaleProfitNew(month, "");
//var objDescription = _service.ListMonthSaleProfitDescription(month, "");
var objDescription = _service.ListMonthSaleProfitNewDescription(month, "");
var list = obj.Select(a => new
......@@ -9278,7 +9281,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
data = list.Where(a => a.isedit == 0).ToList(),
listEdit = list.Where(a => a.isedit == 1).ToList(),
head = listHead,
listCount = objCount
listCount = objCount,
listdesc = objDescription
});
}
catch (Exception ex)
......@@ -9597,6 +9601,25 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
/// <summary>
/// 更新月度销售利润报表的取数描述
/// </summary>
/// <param name="m"></param>
/// <returns></returns>
[BailunAuthentication(LoginMode.Enforce)]
[HttpPost]
public JsonResult UpdateMonthSalesProfitDescription(mMonthSalesProfitDesc_Input m)
{
var user = HttpContextHelper.Current?.User;
var obj = new Services.FinanceReportServices().SaveMonthSaleProfitNewDescription(m, user != null ? user.GetUid() : 0, user != null ? user.GetUserName() : "");
return Json(new
{
success = string.IsNullOrEmpty(obj),
msg = obj
});
}
/// <summary>
/// 导出分类管理成品明细
/// </summary>
/// <param name="start"></param>
......
......@@ -91,7 +91,7 @@
}
];
var url = '@Url.Content("~/Reports/Finance/ListMonthSaleProfitDetailJson")' + '?month=@(ViewBag.month)'+ '&col=@(ViewBag.col)';
var url = '@Url.Content("~/Reports/Finance/ListMonthSaleProfitDetailJson")' + '?month=@(ViewBag.month)'+ '&col=@(ViewBag.col)'+'&isnew=@(ViewBag.isnew)';
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
......@@ -117,7 +117,7 @@
})
uploadfile('btn_Upload',
'@Url.Content("~/Reports/Finance/UploadMonthSaleProfitDetail")' + '?month=@(ViewBag.month)'+ '&col=@(ViewBag.col)' + '&colname=@(ViewBag.colname)' + '&uid=' + uid + '&username=' + username,
'@Url.Content("~/Reports/Finance/UploadMonthSaleProfitDetail")' + '?month=@(ViewBag.month)'+ '&col=@(ViewBag.col)' + '&colname=@(ViewBag.colname)' + '&uid=' + uid + '&username=' + username+'&isnew=@(ViewBag.isnew)',
function(result){
if(result.success)
{
......
......@@ -98,6 +98,14 @@
var objData = result.data[d];
var count = 0;
var objDescription;
for (var d in result.listdesc) {
if (result.listdesc[d].month == objData.month) {
objDescription = result.listdesc[d];
}
}
for (var a in objData) {
if (a == col.item2) {
row += '<td class="showitem ' + col.item2 + '" val="' + objData['month'] + '" valname="' + col.item1 + '">' + objData[a] + '</td>';
......@@ -115,17 +123,30 @@
}
}
//col, val, mon, name
//获取说明描述
var descri = '';
if (objDescription != undefined) {
for (var d in objDescription) {
if (d == col.item2) {
descri = objDescription[d];
}
}
}
if (objEdit != undefined) {
for (var a in objEdit) {
if (a == col.item2) {
row += '<td>' + objEdit[a].replace(/,/g, '') + (col.item3 == 1 ? "" : ('<a href="javascript:;" onclick="EditFee(\'' + col.item1 + '\',\'' + col.item2 + '\',' + objEdit[a].replace(/,/g, '') + ',\'' + objData.month + '\')">编辑</a>'))+'</td>';
row += '<td>' + objEdit[a].replace(/,/g, '') + (col.item3 == 1 ? "" : ('<img src="/img/icon-quetion.png" style="width:18px;margin-left:3px" title="' + descri + '" /><a href="javascript:;" onclick="EditFee(\'' + col.item1 + '\',\'' + col.item2 + '\',' + objEdit[a].replace(/,/g, '') + ',\'' + objData.month + '\')">编辑</a><a style="color:#bbb;" onclick=\"EditDescription(\'' + col.item2 + '\',\'' + descri + '\',\'' + objData.month + '\',\'' + col.item1 + '\')\">修改说明</a><a style="color:#bbb;" onclick=\"ShowDetail(\'' + col.item2 + '\',\'' + objData.month + '\',\'' + col.item1 + '\')\">明细</a>'))+'</td>';
//count += parseFloat(objEdit[a].replace(/,/g, ''));
continue;
}
}
}
else {
row += '<td>0' + (col.item3 == 1 ? "" :'<a href="javascript:;" onclick="EditFee(\'' + col.item1 +'\',\'' + col.item2 + '\',0,\'' + objData.month + '\')">编辑</a>')+'</td>';
row += '<td>0' + (col.item3 == 1 ? "" : '<img src="/img/icon-quetion.png" style="width:18px;margin-left:3px" title="' + descri + '" /><a href="javascript:;" onclick="EditFee(\'' + col.item1 + '\',\'' + col.item2 + '\',0,\'' + objData.month + '\')">编辑</a><a style="color:#bbb;" onclick=\"EditDescription(\'' + col.item2 + '\',\'' + descri + '\',\'' + objData.month + '\',\'' + col.item1 + '\')\">修改说明</a><a style="color:#bbb;" onclick=\"ShowDetail(\'' + col.item2 + '\',\'' + objData.month + '\',\'' + col.item1 + '\')\">明细</a>')+'</td>';
}
......@@ -319,7 +340,7 @@
function SaveDescription(col, val, mon) {
$.submit({
url: '@Url.Content("~/Reports/Finance/UpdateMonthSaleProfitDescription")',
url: '@Url.Content("~/Reports/Finance/UpdateMonthSalesProfitDescription")',
paramData: 'month=' + mon+'&'+col+'='+val,
type:'POST',
func: function (result) {
......@@ -337,7 +358,7 @@
}
function ShowDetail(col, mon, name) {
layer_show(mon + ' ' + name + "的明细", '@Url.Content("~/Reports/Finance/MonthSaleProfitDetails")' + '?month=' + mon + '&col=' + col + '&colname=' + name, '95%', '95%');
layer_show(mon + ' ' + name + "的明细", '@Url.Content("~/Reports/Finance/MonthSaleProfitDetails")' + '?month=' + mon + '&col=' + col + '&colname=' + name+"&isnew=1", '95%', '95%');
}
function exportxls() {
......
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