待上传商品筛选配置保存
This commit is contained in:
1 parent
ab4f94e320
commit
1b9d2244c8
2 files changed
+444
-4
No files matched your search
@@ -1,4 +1,4 @@
|
||||
using AllBase;
|
||||
using AllBase;
|
||||
using AllBase.Extension;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Config;
|
||||
@@ -38,6 +38,7 @@ using Work;
|
||||
using Work.BLL.Tools;
|
||||
using Work.Services;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Rebar;
|
||||
|
||||
namespace TemuKJD.WXForms.ProductForms
|
||||
{
|
||||
@@ -79,7 +80,50 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
DataContext<WaitingProductConfig> _bs;
|
||||
|
||||
WaitingProductConfig waiting_product_config = new WaitingProductConfig();
|
||||
|
||||
void InitWaitingProductConfigBinding()
|
||||
{
|
||||
Debug.WriteLine($"初始化配置");
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
waiting_product_config = NaiBa.Util.Helper.ConfigHelper.LoadConfig<WaitingProductConfig>(nameof(waiting_product_config));
|
||||
if (waiting_product_config == null)
|
||||
{
|
||||
waiting_product_config = new WaitingProductConfig();
|
||||
}
|
||||
_bs = new DataContext<WaitingProductConfig>(waiting_product_config);
|
||||
//NaiBa.Util.Helper.ConfigHelper.SaveConfig<AddPriceRule>("wx_default_add_price_rule", defaultAddPriceRule);
|
||||
////txtIdFilter.Bind<wx_qualification_image_info>(_bs,a=>a.)
|
||||
txtIdFilter.Bind(_bs, a => a.Text, a => a.IdFilter);
|
||||
txtSearchGoodsName.Bind(_bs, a => a.Text, a => a.SearchGoodsName);
|
||||
cmbSourceType.Bind(_bs, a => a.Text, a => a.SourceType);
|
||||
cmbGroupFilter.Bind(_bs, a => a.Text, a => a.GroupFilter);
|
||||
cmbHot.Bind(_bs, a => a.Text, a => a.Hot);
|
||||
cmbWxSafe.Bind(_bs, a => a.Text, a => a.WxSafe);
|
||||
cmbCateFilter1.Bind(_bs, a => a.Text, a => a.CateFilter1);
|
||||
cmbCateFilter2.Bind(_bs, a => a.Text, a => a.CateFilter2);
|
||||
cmbCateFilter3.Bind(_bs, a => a.Text, a => a.CateFilter3);
|
||||
cmbNotes.Bind(_bs, a => a.Text, a => a.Notes);
|
||||
cmbJstInitSet.Bind(_bs, a => a.Text, a => a.JstInitSet);
|
||||
txtAddCount.Bind(_bs, a => a.Text, a => a.AddCount);
|
||||
chkSkipQualification.Bind(_bs, a => a.Checked, a => a.SkipQualification);
|
||||
chkRandomFissionProduct.Bind(_bs, a => a.Checked, a => a.RandomFissionProduct);
|
||||
txtRandomFissionProductCount.Bind(_bs, a => a.Text, a => a.RandomFissionProductCount);
|
||||
chkWXComplateProd.Bind(_bs, a => a.Checked, a => a.WXComplateProd);
|
||||
chkUpdateInDays.Bind(_bs, a => a.Checked, a => a.UpdateInDaysChecked);
|
||||
txtUpdateInDays.Bind(_bs, a => a.Text, a => a.UpdateInDays);
|
||||
cmbUpdateInDays.Bind(_bs, a => a.Text, a => a.UpdateInDaysType);
|
||||
chkFilterViewUv.Bind(_bs, a => a.Checked, a => a.FilterViewUvChecked);
|
||||
numFilterViewUv.Bind(_bs, a => a.Value, a => a.FilterViewUv);
|
||||
chkFilterSaleCountNum.Bind(_bs, a => a.Checked, a => a.FilterSaleCountNumChecked);
|
||||
numFilterSaleCountNum.Bind(_bs, a => a.Value, a => a.FilterSaleCountNum);
|
||||
}));
|
||||
Debug.WriteLine($"初始化配置END");
|
||||
|
||||
}
|
||||
private void UserSelectDbProductForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Instance = this;
|
||||
@@ -167,6 +211,8 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
catch { }
|
||||
|
||||
|
||||
|
||||
txtAddTimes.TextChanged -= txtAddPrice_TextChanged;
|
||||
txtAddMorePrice.TextChanged -= txtAddPrice_TextChanged;
|
||||
txtSinglePriceAdd.TextChanged -= txtAddPrice_TextChanged;
|
||||
@@ -611,7 +657,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
{
|
||||
RefreshShopLogin();
|
||||
updateAuthor();
|
||||
RefreshDbProdGroupAndCate();
|
||||
RefreshDbProdGroupAndCate(InitWaitingProductConfigBinding);
|
||||
lblWaitToUp.Text = "待上传 " + lstTemuDBProductSelect.Count + " 件";
|
||||
|
||||
if (!isInit)
|
||||
@@ -637,7 +683,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshDbProdGroupAndCate()
|
||||
private void RefreshDbProdGroupAndCate(Action call = null)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
@@ -664,7 +710,10 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.btnSwitchCatType.Text = "P";
|
||||
btnSwitchCatType_Click(null, null);
|
||||
pbLoadingShop.Visible = false;
|
||||
|
||||
}));
|
||||
call?.Invoke();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -989,6 +1038,8 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
private void btnUpload_Click(object sender, EventArgs e)
|
||||
{
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig<WaitingProductConfig>(nameof(waiting_product_config), waiting_product_config);
|
||||
|
||||
var shopIdLst = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
|
||||
=> row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
|
||||
if (shopIdLst.Count <= 0)
|
||||
@@ -2095,7 +2146,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// 同颜色规格向下浮动同价格
|
||||
if (chkSameSpecPriceDown.Checked)
|
||||
{
|
||||
var priceTextLst = dbProd.price_text.ParseToString().Split('-');
|
||||
var priceTextLst = dbProd.price_text.ParseToString().Split('-');
|
||||
if (priceTextLst.Length != 2 || priceTextLst[0] != priceTextLst[1])
|
||||
{
|
||||
Dictionary<string, int> specPriceDic = new Dictionary<string, int>();
|
||||
@@ -7030,6 +7081,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
private void cmbCateFilter1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
Debug.WriteLine($"Filter1 修改:{cmbCateFilter1.Text}");
|
||||
//if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "1688厂家" && cmbSourceType.Text != "微信店采" && cmbSourceType.Text != "微信小店")
|
||||
if (btnSwitchCatType.Text != "W")
|
||||
return;
|
||||
@@ -7051,6 +7103,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
private void cmbCateFilter2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
Debug.WriteLine($"Filter1 修改:{cmbCateFilter2.Text}");
|
||||
//if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "1688厂家" && cmbSourceType.Text != "微信店采" && cmbSourceType.Text != "微信小店")
|
||||
if (btnSwitchCatType.Text != "W")
|
||||
return;
|
||||
@@ -7998,4 +8051,241 @@ Content-Type: application/octet-stream
|
||||
public string PlatformUrl { get; set; }
|
||||
public bool IsCache { get; set; }
|
||||
}
|
||||
|
||||
class WaitingProductConfig : BindableBase
|
||||
{
|
||||
public WaitingProductConfig()
|
||||
{
|
||||
IdFilter = "";
|
||||
SearchGoodsName = "";
|
||||
SourceType = "厂商直采";
|
||||
GroupFilter = "";
|
||||
Hot = "普通商品";
|
||||
WxSafe = "安全+未校验";
|
||||
CateFilter1 = "全部";
|
||||
CateFilter2 = "全部";
|
||||
CateFilter3 = "全部";
|
||||
Notes = "";
|
||||
JstInitSet = "是";
|
||||
AddCount = "500";
|
||||
SkipQualification = false;
|
||||
RandomFissionProduct = false;
|
||||
RandomFissionProductCount = "100";
|
||||
WXComplateProd = false;
|
||||
UpdateInDaysChecked = false;
|
||||
UpdateInDays = "30";
|
||||
UpdateInDaysType = "新增";
|
||||
FilterViewUvChecked = false;
|
||||
FilterViewUv = 200m;
|
||||
FilterSaleCountNumChecked = false;
|
||||
FilterSaleCountNum = 1m;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// txtIdFilter
|
||||
/// </summary>
|
||||
public string IdFilter
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// txtSearchGoodsName
|
||||
/// </summary>
|
||||
public string SearchGoodsName
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cmbSourceType
|
||||
/// </summary>
|
||||
public string SourceType
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cmbGroupFilter
|
||||
/// </summary>
|
||||
public string GroupFilter
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cmbHot
|
||||
/// </summary>
|
||||
public string Hot
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cmbWxSafe
|
||||
/// </summary>
|
||||
public string WxSafe
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cmbCateFilter1
|
||||
/// </summary>
|
||||
public string CateFilter1
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cmbCateFilter2
|
||||
/// </summary>
|
||||
public string CateFilter2
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => base.SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cmbCateFilter3
|
||||
/// </summary>
|
||||
public string CateFilter3
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cmbNotes
|
||||
/// </summary>
|
||||
public string Notes
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cmbJstInitSet
|
||||
/// </summary>
|
||||
public string JstInitSet
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// txtAddCount
|
||||
/// </summary>
|
||||
public string AddCount
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// chkSkipQualification
|
||||
/// </summary>
|
||||
public bool SkipQualification
|
||||
{
|
||||
get => GetValue<bool>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// chkRandomFissionProduct
|
||||
/// </summary>
|
||||
public bool RandomFissionProduct
|
||||
{
|
||||
get => GetValue<bool>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// txtRandomFissionProductCount
|
||||
/// </summary>
|
||||
public string RandomFissionProductCount
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// chkWXComplateProd
|
||||
/// </summary>
|
||||
public bool WXComplateProd
|
||||
{
|
||||
get => GetValue<bool>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// chkUpdateInDays
|
||||
/// </summary>
|
||||
public bool UpdateInDaysChecked
|
||||
{
|
||||
get => GetValue<bool>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// txtUpdateInDays
|
||||
/// </summary>
|
||||
public string UpdateInDays
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// cmbUpdateInDays
|
||||
/// </summary>
|
||||
public string UpdateInDaysType
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// chkFilterViewUv
|
||||
/// </summary>
|
||||
public bool FilterViewUvChecked
|
||||
{
|
||||
get => GetValue<bool>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// numFilterViewUv
|
||||
/// </summary>
|
||||
public decimal FilterViewUv
|
||||
{
|
||||
get => GetValue<decimal>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// chkFilterSaleCountNum
|
||||
/// </summary>
|
||||
public bool FilterSaleCountNumChecked
|
||||
{
|
||||
get => GetValue<bool>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// numFilterSaleCountNum
|
||||
/// </summary>
|
||||
public decimal FilterSaleCountNum
|
||||
{
|
||||
get => GetValue<decimal>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user