Commit db2bab6c by DESKTOP-732ATD8\BLT

修改功能:销售利润汇率改为财务汇率计算

parent 73a8a424
...@@ -52,7 +52,7 @@ namespace Bailun.DC.Models ...@@ -52,7 +52,7 @@ namespace Bailun.DC.Models
{ {
get get
{ {
return amount_sales * seller_order_exchange_rate * quantity_shipped; return amount_sales * (finance_order_exchange_rate ?? seller_order_exchange_rate) * quantity_shipped;
} }
} }
...@@ -113,10 +113,11 @@ namespace Bailun.DC.Models ...@@ -113,10 +113,11 @@ namespace Bailun.DC.Models
public decimal shipping { get; set; } public decimal shipping { get; set; }
private decimal _seller_order_exchange_rate;
/// <summary> /// <summary>
/// 订单汇率 /// 订单汇率
/// </summary> /// </summary>
public decimal seller_order_exchange_rate { get; set; } public decimal seller_order_exchange_rate { get { return finance_order_exchange_rate ?? _seller_order_exchange_rate; } set { _seller_order_exchange_rate = value; } }
/// <summary> /// <summary>
...@@ -126,6 +127,12 @@ namespace Bailun.DC.Models ...@@ -126,6 +127,12 @@ namespace Bailun.DC.Models
/// <summary> /// <summary>
/// 财务汇率
/// </summary>
public decimal? finance_order_exchange_rate { get; set; }
/// <summary>
/// 物流汇率 /// 物流汇率
/// </summary> /// </summary>
public decimal wms_to_cny_exchange_rate { get; set; } public decimal wms_to_cny_exchange_rate { get; set; }
...@@ -167,10 +174,15 @@ namespace Bailun.DC.Models ...@@ -167,10 +174,15 @@ namespace Bailun.DC.Models
public DateTime createtime { get; set; } public DateTime createtime { get; set; }
public string origin_order_id { get; set; } public string origin_order_id { get; set; }
public string bailun_order_id { get; set; } public string bailun_order_id { get; set; }
public decimal sale_profit { get; set; } public decimal sale_profit { get; set; }
/// <summary>
/// 订单币种
/// </summary>
public string order_currency { get; set; }
} }
} }
...@@ -886,7 +886,7 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code ...@@ -886,7 +886,7 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
return; return;
} }
var sql = $@"select t1.id as pickid,t2.id as orderskuid,t2.bailun_sku,t2.amount_sales,t2.cost_product,t2.cost_platform_fee,t2.cost_paypal_fee,t2.cost_first,t2.cost_logistics,t2.cost_handle_platform,t2.total_fee,t2.seller_order_exchange_rate,t2.seller_other_exchange_rate,t2.wms_to_cny_exchange_rate,t2.shipping,t1.quantity_shipped,t1.shipping_time,t2.platform_type,t2.cost_fba_fee,if(t6.financecategoryname is null,'',t6.financecategoryname) as financecategoryname var sql = $@"select t1.id as pickid,t2.id as orderskuid,t2.bailun_sku,t2.amount_sales,t2.cost_product,t2.cost_platform_fee,t2.cost_paypal_fee,t2.cost_first,t2.cost_logistics,t2.cost_handle_platform,t2.total_fee,t2.seller_order_exchange_rate,t2.seller_other_exchange_rate,t2.wms_to_cny_exchange_rate,t2.shipping,t1.quantity_shipped,t1.shipping_time,t2.platform_type,t2.cost_fba_fee,if(t6.financecategoryname is null,'',t6.financecategoryname) as financecategoryname,t2.order_currency
from dc_base_oms_pick t1 from dc_base_oms_pick t1
join dc_base_oms_sku t2 on t1.bailun_order_id = t2.bailun_order_id and t1.bailun_sku=t2.bailun_sku and t2.bailun_order_status != 'Canceled' and t2.has_scalp = 0 and ((t2.platform_type!='FBA' and t2.bailun_order_status!='CantHandle') or t2.platform_type='FBA') and t2.has_scalp = 0 and t2.has_innersale = 0 and t2.has_delete=0 and t2.company_id=1 join dc_base_oms_sku t2 on t1.bailun_order_id = t2.bailun_order_id and t1.bailun_sku=t2.bailun_sku and t2.bailun_order_status != 'Canceled' and t2.has_scalp = 0 and ((t2.platform_type!='FBA' and t2.bailun_order_status!='CantHandle') or t2.platform_type='FBA') and t2.has_scalp = 0 and t2.has_innersale = 0 and t2.has_delete=0 and t2.company_id=1
left join dc_base_sku t5 on t2.bailun_sku=t5.bailun_sku left join dc_base_sku t5 on t2.bailun_sku=t5.bailun_sku
...@@ -902,10 +902,10 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code ...@@ -902,10 +902,10 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
while (page==0||(page*pagesize)<objOrder.Count) while (page==0||(page*pagesize)<objOrder.Count)
{ {
var tempList = objOrder.Skip(page*pagesize).Take(pagesize).ToList(); var tempList = objOrder.Skip(page*pagesize).Take(pagesize).ToList();
var str = "insert dc_month_sales_profit_orderdetail (month,pickid,orderskuid,bailun_sku,amount_sales,cost_product,cost_platform_fee,cost_paypal_fee,cost_first,cost_logistics,cost_handle_platform,total_fee,shipping,seller_order_exchange_rate,seller_other_exchange_rate,wms_to_cny_exchange_rate,quantity_shipped,shipping_time,platform_type,cost_fba_fee,financecategoryname) values "; var str = "insert dc_month_sales_profit_orderdetail (month,pickid,orderskuid,bailun_sku,amount_sales,cost_product,cost_platform_fee,cost_paypal_fee,cost_first,cost_logistics,cost_handle_platform,total_fee,shipping,seller_order_exchange_rate,seller_other_exchange_rate,wms_to_cny_exchange_rate,quantity_shipped,shipping_time,platform_type,cost_fba_fee,financecategoryname,order_currency) values ";
foreach(var item in tempList) foreach(var item in tempList)
{ {
str += $"('{day.ToString("yyyy-MM")}',{item.pickid},{item.orderskuid},'{item.bailun_sku}',{item.amount_sales},{item.cost_product},{item.cost_platform_fee},{item.cost_paypal_fee},{item.cost_first},{item.cost_logistics},{item.cost_handle_platform},{item.total_fee},{item.shipping},{item.seller_order_exchange_rate},{item.seller_other_exchange_rate},{item.wms_to_cny_exchange_rate},{item.quantity_shipped},'{item.shipping_time.ToString("yyyy-MM-dd HH:mm:ss")}','{item.platform_type}',{item.cost_fba_fee},'{item.financecategoryname}'),"; str += $"('{day.ToString("yyyy-MM")}',{item.pickid},{item.orderskuid},'{item.bailun_sku}',{item.amount_sales},{item.cost_product},{item.cost_platform_fee},{item.cost_paypal_fee},{item.cost_first},{item.cost_logistics},{item.cost_handle_platform},{item.total_fee},{item.shipping},{item.seller_order_exchange_rate},{item.seller_other_exchange_rate},{item.wms_to_cny_exchange_rate},{item.quantity_shipped},'{item.shipping_time.ToString("yyyy-MM-dd HH:mm:ss")}','{item.platform_type}',{item.cost_fba_fee},'{item.financecategoryname}','{item.order_currency}'),";
} }
Console.WriteLine($"总记录数:{objOrder.Count},第{(page + 1)}页,记录数:{tempList.Count} {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"总记录数:{objOrder.Count},第{(page + 1)}页,记录数:{tempList.Count} {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
...@@ -913,7 +913,7 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code ...@@ -913,7 +913,7 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
page++; page++;
} }
sql = $@"select 0 as pickid,tb.id as orderskuid,tb.bailun_sku,tb.amount_sales,tb.cost_product,tb.cost_platform_fee,tb.cost_paypal_fee,tb.cost_first,tb.cost_logistics,tb.cost_handle_platform,tb.total_fee,tb.seller_order_exchange_rate,tb.seller_other_exchange_rate,tb.wms_to_cny_exchange_rate,tb.shipping,tb.bailun_sku_quantity_ordered as quantity_shipped,tb.purchase_create_time as shipping_time,tb.platform_type,tb.cost_fba_fee,if(t6.financecategoryname is null,'',t6.financecategoryname) as financecategoryname sql = $@"select 0 as pickid,tb.id as orderskuid,tb.bailun_sku,tb.amount_sales,tb.cost_product,tb.cost_platform_fee,tb.cost_paypal_fee,tb.cost_first,tb.cost_logistics,tb.cost_handle_platform,tb.total_fee,tb.seller_order_exchange_rate,tb.seller_other_exchange_rate,tb.wms_to_cny_exchange_rate,tb.shipping,tb.bailun_sku_quantity_ordered as quantity_shipped,tb.purchase_create_time as shipping_time,tb.platform_type,tb.cost_fba_fee,if(t6.financecategoryname is null,'',t6.financecategoryname) as financecategoryname,tb.order_currency
from dc_base_oms_sku tb left join dc_base_sku t5 on tb.bailun_sku=t5.bailun_sku from dc_base_oms_sku tb left join dc_base_sku t5 on tb.bailun_sku=t5.bailun_sku
left join dc_base_sku_finance_category t6 on t6.bailuncategoryid=t5.bailun_category_id left join dc_base_sku_finance_category t6 on t6.bailuncategoryid=t5.bailun_category_id
where tb.company_id=1 and tb.bailun_order_status!='Canceled' and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('None','Failed') and tb.platform_type='FBA' and tb.purchase_create_time>='{day.ToString("yyyy-MM-dd")}' and tb.purchase_create_time<'{day.AddMonths(1).ToString("yyyy-MM-dd")}' where tb.company_id=1 and tb.bailun_order_status!='Canceled' and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('None','Failed') and tb.platform_type='FBA' and tb.purchase_create_time>='{day.ToString("yyyy-MM-dd")}' and tb.purchase_create_time<'{day.AddMonths(1).ToString("yyyy-MM-dd")}'
...@@ -926,10 +926,10 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code ...@@ -926,10 +926,10 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
while (page == 0 || (page * pagesize) < objFBA.Count) while (page == 0 || (page * pagesize) < objFBA.Count)
{ {
var tempList = objFBA.Skip(page*pagesize).Take(pagesize).ToList(); var tempList = objFBA.Skip(page*pagesize).Take(pagesize).ToList();
var str = "insert dc_month_sales_profit_orderdetail (month,pickid,orderskuid,bailun_sku,amount_sales,cost_product,cost_platform_fee,cost_paypal_fee,cost_first,cost_logistics,cost_handle_platform,total_fee,shipping,seller_order_exchange_rate,seller_other_exchange_rate,wms_to_cny_exchange_rate,quantity_shipped,shipping_time,platform_type,cost_fba_fee,financecategoryname) values "; var str = "insert dc_month_sales_profit_orderdetail (month,pickid,orderskuid,bailun_sku,amount_sales,cost_product,cost_platform_fee,cost_paypal_fee,cost_first,cost_logistics,cost_handle_platform,total_fee,shipping,seller_order_exchange_rate,seller_other_exchange_rate,wms_to_cny_exchange_rate,quantity_shipped,shipping_time,platform_type,cost_fba_fee,financecategoryname,order_currency) values ";
foreach (var item in tempList) foreach (var item in tempList)
{ {
str += $"('{day.ToString("yyyy-MM")}',{item.pickid},{item.orderskuid},'{item.bailun_sku}',{item.amount_sales},{item.cost_product},{item.cost_platform_fee},{item.cost_paypal_fee},{item.cost_first},{item.cost_logistics},{item.cost_handle_platform},{item.total_fee},{item.shipping},{item.seller_order_exchange_rate},{item.seller_other_exchange_rate},{item.wms_to_cny_exchange_rate},{item.quantity_shipped},'{item.shipping_time.ToString("yyyy-MM-dd HH:mm:ss")}','{item.platform_type}',{item.cost_fba_fee},'{item.financecategoryname}'),"; str += $"('{day.ToString("yyyy-MM")}',{item.pickid},{item.orderskuid},'{item.bailun_sku}',{item.amount_sales},{item.cost_product},{item.cost_platform_fee},{item.cost_paypal_fee},{item.cost_first},{item.cost_logistics},{item.cost_handle_platform},{item.total_fee},{item.shipping},{item.seller_order_exchange_rate},{item.seller_other_exchange_rate},{item.wms_to_cny_exchange_rate},{item.quantity_shipped},'{item.shipping_time.ToString("yyyy-MM-dd HH:mm:ss")}','{item.platform_type}',{item.cost_fba_fee},'{item.financecategoryname}','{item.order_currency}'),";
} }
Console.WriteLine($"总记录数:{objFBA.Count},第{(page + 1)}页,记录数:{tempList.Count} {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"总记录数:{objFBA.Count},第{(page + 1)}页,记录数:{tempList.Count} {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
......
...@@ -180,19 +180,19 @@ namespace Bailun.DC.Services.WebApiService ...@@ -180,19 +180,19 @@ namespace Bailun.DC.Services.WebApiService
{ {
sqlText.Append(" AND t1.create_time >= @StartCreateTime AND t1.create_time < @EndCreateTime "); sqlText.Append(" AND t1.create_time >= @StartCreateTime AND t1.create_time < @EndCreateTime ");
parameters.Add("StartCreateTime", Convert.ToDateTime(input.CreateTime[0])); parameters.Add("StartCreateTime", Convert.ToDateTime(input.CreateTime[0]));
parameters.Add("EndCreateTime", Convert.ToDateTime(input.CreateTime[1])); parameters.Add("EndCreateTime", Convert.ToDateTime(input.CreateTime[1]).AddDays(1));
} }
if (input.LastModifyDate != null && input.LastModifyDate.Length == 2 && !string.IsNullOrWhiteSpace(input.LastModifyDate[0]) && !string.IsNullOrWhiteSpace(input.LastModifyDate[1])) if (input.LastModifyDate != null && input.LastModifyDate.Length == 2 && !string.IsNullOrWhiteSpace(input.LastModifyDate[0]) && !string.IsNullOrWhiteSpace(input.LastModifyDate[1]))
{ {
sqlText.Append(" AND t1.last_modify_date >= @StartLastModifyDate AND t1.last_modify_date < @EndLastModifyDate "); sqlText.Append(" AND t1.last_modify_date >= @StartLastModifyDate AND t1.last_modify_date < @EndLastModifyDate ");
parameters.Add("StartLastModifyDate", Convert.ToDateTime(input.LastModifyDate[0])); parameters.Add("StartLastModifyDate", Convert.ToDateTime(input.LastModifyDate[0]));
parameters.Add("EndLastModifyDate", Convert.ToDateTime(input.LastModifyDate[1])); parameters.Add("EndLastModifyDate", Convert.ToDateTime(input.LastModifyDate[1]).AddDays(1));
} }
if (input.PayTime != null && input.PayTime.Length == 2 && !string.IsNullOrWhiteSpace(input.PayTime[0]) && !string.IsNullOrWhiteSpace(input.PayTime[1])) if (input.PayTime != null && input.PayTime.Length == 2 && !string.IsNullOrWhiteSpace(input.PayTime[0]) && !string.IsNullOrWhiteSpace(input.PayTime[1]))
{ {
sqlText.Append(" AND t1.pay_time = @StartPayTime AND t1.pay_time < @EndPayTime "); sqlText.Append(" AND t1.pay_time >= @StartPayTime AND t1.pay_time < @EndPayTime ");
parameters.Add("StartPayTime", Convert.ToDateTime(input.PayTime[0])); parameters.Add("StartPayTime", Convert.ToDateTime(input.PayTime[0]));
parameters.Add("EndPayTime", Convert.ToDateTime(input.PayTime[1])); parameters.Add("EndPayTime", Convert.ToDateTime(input.PayTime[1]).AddDays(1));
} }
sqlText.Append(" ORDER BY t1.create_time DESC "); sqlText.Append(" ORDER BY t1.create_time DESC ");
return sqlText.ToString(); return sqlText.ToString();
...@@ -483,9 +483,10 @@ SUM(t1.cost_product * t1.quantity_shipped) AS total_amount_sales,COUNT(0) total_ ...@@ -483,9 +483,10 @@ SUM(t1.cost_product * t1.quantity_shipped) AS total_amount_sales,COUNT(0) total_
else else
{ {
sql.Append(@"SELECT t1.platform_type, SUM(t1.amount_sales * t1.quantity_shipped) AS original_amount, sql.Append(@"SELECT t1.platform_type, SUM(t1.amount_sales * t1.quantity_shipped) AS original_amount,
SUM(t1.amount_sales * t1.seller_order_exchange_rate * t1.quantity_shipped) AS total_amount_sales,COUNT(0)AS total_order FROM dc_month_sales_profit_orderdetail AS t1 "); SUM(t1.amount_sales * (IFNULL(t3.exchange_rate,t1.seller_order_exchange_rate)) * t1.quantity_shipped) AS total_amount_sales,COUNT(0)AS total_order FROM dc_month_sales_profit_orderdetail AS t1 ");
} }
sql.Append("INNER JOIN dc_base_oms_sku AS t2 ON t1.orderskuid = t2.id "); sql.Append("INNER JOIN dc_base_oms_sku AS t2 ON t1.orderskuid = t2.id ");
sql.Append("LEFT JOIN dc_exchange_rate_finance t3 ON t1.order_currency = t3.`code` and t1.`month` = t3.`month` ");
sql.Append($"WHERE t1.`month` ='{month}' "); sql.Append($"WHERE t1.`month` ='{month}' ");
if (!string.IsNullOrEmpty(financecategory) && financecategory != "其他") if (!string.IsNullOrEmpty(financecategory) && financecategory != "其他")
{ {
...@@ -540,9 +541,10 @@ SUM(t1.amount_sales * t1.seller_order_exchange_rate * t1.quantity_shipped) AS to ...@@ -540,9 +541,10 @@ SUM(t1.amount_sales * t1.seller_order_exchange_rate * t1.quantity_shipped) AS to
{ {
parameters = new DynamicParameters(); parameters = new DynamicParameters();
StringBuilder sqlText = new StringBuilder(); StringBuilder sqlText = new StringBuilder();
sqlText.Append($@"SELECT t1.*, t2.origin_order_id, t2.bailun_order_id sqlText.Append($@"SELECT t1.*, t2.origin_order_id, t2.bailun_order_id, t3.exchange_rate as finance_order_exchange_rate
FROM dc_month_sales_profit_orderdetail t1 FROM dc_month_sales_profit_orderdetail t1
JOIN dc_base_oms_sku t2 ON t1.orderskuid = t2.id JOIN dc_base_oms_sku t2 ON t1.orderskuid = t2.id
LEFT JOIN dc_exchange_rate_finance t3 ON t1.order_currency = t3.`code` and t1.`month` = t3.`month`
WHERE WHERE
t1. MONTH = @Month "); t1. MONTH = @Month ");
parameters.Add("Month", input.Month); parameters.Add("Month", input.Month);
......
...@@ -50,7 +50,13 @@ ...@@ -50,7 +50,13 @@
v-bind:placeholder="item.placeholder || ('请选择' + (item.label || item.name || ''))" v-bind:placeholder="item.placeholder || ('请选择' + (item.label || item.name || ''))"
v-bind:size="item.size || 'small'" v-bind:size="item.size || 'small'"
v-bind:type="item.type" v-bind:type="item.type"
v-bind:picker-options="{shortcuts: [{text: '今天',onClick:function(picker) {picker.$emit('pick', [new Date(),new Date()])}},{text: '今周',onClick:function(picker) {var date = new Date();picker.$emit('pick', [new Date(date.setDate(date.getDate()-date.getDay()+1)),new Date(date.setDate(date.getDate()-date.getDay()+7))])}},{text: '上周',onClick:function(picker) {var date = new Date();picker.$emit('pick', [new Date(date.setDate(date.getDate()-date.getDay()+1-7)),new Date(date.setDate(date.getDate()-date.getDay()+7))])}}]}"> v-bind:picker-options="{shortcuts: [
{text: '今天',onClick:function(picker) {picker.$emit('pick', [new Date(),new Date()])}},
{text: '今周',onClick:function(picker) {var date = new Date();picker.$emit('pick', [new Date(date.setDate(date.getDate()-date.getDay()+1)),new Date(date.setDate(date.getDate()-date.getDay()+7))])}},
{text: '今月',onClick:function(picker) {var date = new Date();picker.$emit('pick', [new Date(date.setDate(1)),new Date(date.setMonth(date.getMonth() + 1) - (24 * 60 * 60 * 1000))])}},
{text: '上周',onClick:function(picker) {var date = new Date();picker.$emit('pick', [new Date(date.setDate(date.getDate()-date.getDay()+1-7)),new Date(date.setDate(date.getDate()-date.getDay()+7))])}},
{text: '上月',onClick:function(picker) {var date = new Date();picker.$emit('pick', [new Date(new Date(date.setMonth(date.getMonth()-1)).setDate(1)),new Date(new Date(date.setMonth(date.getMonth() + 1)).setDate(1) - (24 * 60 * 60 * 1000))])}},
]}">
</el-date-picker> </el-date-picker>
<el-date-picker v-else-if="item.type == 'date'" <el-date-picker v-else-if="item.type == 'date'"
v-model="item_value" v-model="item_value"
......
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
} }
.el-picker-panel.el-date-range-picker.el-popper.has-sidebar .el-picker-panel__sidebar { .el-picker-panel.el-date-range-picker.el-popper.has-sidebar .el-picker-panel__sidebar {
left: 100px; left: 70px;
} }
.el-picker-panel.el-date-range-picker.el-popper.has-sidebar .el-picker-panel__body .el-picker-panel__content.el-date-range-picker__content { .el-picker-panel.el-date-range-picker.el-popper.has-sidebar .el-picker-panel__body .el-picker-panel__content.el-date-range-picker__content {
......
...@@ -122,6 +122,26 @@ ...@@ -122,6 +122,26 @@
case 'month': case 'month':
case 'date': case 'date':
that.$set(that, "item_value", that.item.defaultValue == 'new Date()' ? new Date() : that.item.defaultValue); that.$set(that, "item_value", that.item.defaultValue == 'new Date()' ? new Date() : that.item.defaultValue);
case 'daterange':
var date = new Date();
switch (that.item.defaultValue) {
case "new Date()":
date = [new Date(), new Date()];
break;
case "curr day()":
date = [new Date(date.setDate(date.getDate() - date.getDay() + 1)), new Date(date.setDate(date.getDate() - date.getDay() + 7))];
break;
case "curr month()":
date = [new Date(date.setDate(1)), new Date(date.setMonth(date.getMonth() + 1) - (24 * 60 * 60 * 1000))];
break;
case "prev day()":
date = [new Date(date.setDate(date.getDate() - date.getDay() + 1 - 7)), new Date(date.setDate(date.getDate() - date.getDay() + 7))];
break;
case "prev month()":
date = [new Date(new Date(date.setMonth(date.getMonth() - 1)).setDate(1)), new Date(new Date(date.setMonth(date.getMonth() + 1)).setDate(1) - (24 * 60 * 60 * 1000))];
break;
}
that.$set(that, "item_value", date);
break; break;
} }
} }
......
...@@ -90,7 +90,32 @@ ...@@ -90,7 +90,32 @@
that.setting.listFilterControl.forEach(function (l) { that.setting.listFilterControl.forEach(function (l) {
//是否默认值 //是否默认值
if (defaultValue) { if (defaultValue) {
Vue.set(l, "value", (l.defaultValue == 'new Date()' ? new Date() : l.defaultValue) || null); //日期
if (l.type == "daterange" || l.type == "date" || l.type == "month") {
var date = new Date();
switch (l.defaultValue) {
case "new Date()":
date = l.type == "daterange" ? [new Date().format("yyyy-MM-dd"), new Date().format("yyyy-MM-dd")] : date;
break;
case "curr day()":
date = [new Date(date.setDate(date.getDate() - date.getDay() + 1)).format("yyyy-MM-dd"), new Date(date.setDate(date.getDate() - date.getDay() + 7)).format("yyyy-MM-dd")];
break;
case "curr month()":
date = [new Date(date.setDate(1)).format("yyyy-MM-dd"), new Date(date.setMonth(date.getMonth() + 1) - (24 * 60 * 60 * 1000)).format("yyyy-MM-dd")];
break;
case "prev day()":
date = [new Date(date.setDate(date.getDate() - date.getDay() + 1 - 7).format("yyyy-MM-dd")), new Date(date.setDate(date.getDate() - date.getDay() + 7)).format("yyyy-MM-dd")];
break;
case "prev month()":
date = [new Date(new Date(date.setMonth(date.getMonth() - 1)).setDate(1)).format("yyyy-MM-dd"), new Date(new Date(date.setMonth(date.getMonth() + 1)).setDate(1) - (24 * 60 * 60 * 1000)).format("yyyy-MM-dd")]
break;
default:
break;
}
Vue.set(l, "value", date);
} else {
Vue.set(l, "value", l.defaultValue);
}
} }
if (l.value) { if (l.value) {
var filter = { field: l.prop }; var filter = { field: l.prop };
...@@ -252,7 +277,7 @@ ...@@ -252,7 +277,7 @@
//清空排序 //清空排序
that.$refs.table.clearSort(); that.$refs.table.clearSort();
Vue.set(that, 'filterParams', { currentPage: 1, pageSize: 10, ListOrder: null }); Vue.set(that, 'filterParams', { currentPage: 1, pageSize: 10, ListOrder: null });
this.onSearch(); that.onSearch(true);
}, },
//导出 //导出
onExport: function () { onExport: function () {
......
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