1删除部分不需要的文件 2货号对应原价导入功能

This commit is contained in:
wule committed 2025-08-14 18:02:28 +08:00
1 parent 0492e87aee
commit 535adc6011
166 files changed
+2091 -55519

No files matched your search

@@ -39,6 +39,7 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProductThirdSelectListManageForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnDel = new DevComponents.DotNetBar.PanelEx();
this.pbFissionSetting = new System.Windows.Forms.PictureBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.cmbUserNotes = new System.Windows.Forms.ComboBox();
@@ -140,6 +141,7 @@
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnDel);
this.splitContainer1.Panel1.Controls.Add(this.pbFissionSetting);
this.splitContainer1.Panel1.Controls.Add(this.tableLayoutPanel1);
this.splitContainer1.Panel1.Controls.Add(this.btnReFission);
@@ -153,11 +155,37 @@
this.splitContainer1.SplitterDistance = 70;
this.splitContainer1.TabIndex = 2;
//
// btnDel
//
this.btnDel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnDel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnDel.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnDel.DisabledBackColor = System.Drawing.Color.Empty;
this.btnDel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDel.Location = new System.Drawing.Point(1280, 39);
this.btnDel.Name = "btnDel";
this.btnDel.Size = new System.Drawing.Size(90, 26);
this.btnDel.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnDel.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnDel.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnDel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnDel.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnDel.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnDel.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnDel.Style.GradientAngle = 90;
this.btnDel.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnDel.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnDel.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnDel.TabIndex = 445;
this.btnDel.Text = "批量删除选中";
this.btnDel.Visible = false;
this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
//
// pbFissionSetting
//
this.pbFissionSetting.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pbFissionSetting.Image = global::TemuKJD.Properties.Resources.齿轮;
this.pbFissionSetting.Location = new System.Drawing.Point(1260, 19);
this.pbFissionSetting.Location = new System.Drawing.Point(1260, 8);
this.pbFissionSetting.Name = "pbFissionSetting";
this.pbFissionSetting.Size = new System.Drawing.Size(26, 26);
this.pbFissionSetting.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -236,7 +264,7 @@
"全部",
"重上",
"已买"});
this.cmbUserNotes.Location = new System.Drawing.Point(1044, 8);
this.cmbUserNotes.Location = new System.Drawing.Point(1044, 5);
this.cmbUserNotes.Margin = new System.Windows.Forms.Padding(0);
this.cmbUserNotes.Name = "cmbUserNotes";
this.cmbUserNotes.Size = new System.Drawing.Size(65, 25);
@@ -253,7 +281,7 @@
"核价成功",
"核价成功(重复)",
"重复"});
this.cmbNotes.Location = new System.Drawing.Point(917, 8);
this.cmbNotes.Location = new System.Drawing.Point(917, 5);
this.cmbNotes.Margin = new System.Windows.Forms.Padding(0);
this.cmbNotes.Name = "cmbNotes";
this.cmbNotes.Size = new System.Drawing.Size(65, 25);
@@ -280,7 +308,7 @@
"已上传",
"草稿箱",
"全部"});
this.cmbStatus.Location = new System.Drawing.Point(814, 8);
this.cmbStatus.Location = new System.Drawing.Point(814, 5);
this.cmbStatus.Margin = new System.Windows.Forms.Padding(0);
this.cmbStatus.Name = "cmbStatus";
this.cmbStatus.Size = new System.Drawing.Size(65, 25);
@@ -705,7 +733,7 @@
this.btnReFission.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReFission.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReFission.ForeColor = System.Drawing.Color.White;
this.btnReFission.Location = new System.Drawing.Point(1280, 19);
this.btnReFission.Location = new System.Drawing.Point(1280, 8);
this.btnReFission.Margin = new System.Windows.Forms.Padding(2);
this.btnReFission.Name = "btnReFission";
this.btnReFission.Size = new System.Drawing.Size(90, 26);
@@ -723,7 +751,7 @@
this.btnSetSubSa.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSetSubSa.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSetSubSa.ForeColor = System.Drawing.Color.White;
this.btnSetSubSa.Location = new System.Drawing.Point(1372, 19);
this.btnSetSubSa.Location = new System.Drawing.Point(1372, 8);
this.btnSetSubSa.Margin = new System.Windows.Forms.Padding(2);
this.btnSetSubSa.Name = "btnSetSubSa";
this.btnSetSubSa.Size = new System.Drawing.Size(90, 26);
@@ -740,7 +768,7 @@
this.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAdd.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAdd.ForeColor = System.Drawing.Color.White;
this.btnAdd.Location = new System.Drawing.Point(1464, 19);
this.btnAdd.Location = new System.Drawing.Point(1464, 8);
this.btnAdd.Margin = new System.Windows.Forms.Padding(2);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(90, 26);
@@ -1181,5 +1209,6 @@
private System.Windows.Forms.ComboBox cmbUserNotes;
private System.Windows.Forms.ComboBox cmbNotes;
private System.Windows.Forms.ComboBox cmbStatus;
private DevComponents.DotNetBar.PanelEx btnDel;
}
}
@@ -154,7 +154,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
prodSelect.add_time.ToString("yy/MM/dd\r\n HH:mm"),
prodSelect.status == "待上传" ? "-" : prodSelect.mdy_time.ToString("yy/MM/dd\r\n HH:mm"),
string.IsNullOrEmpty(prodSelect.operate_sub_sa_name) ? "-" : prodSelect.operate_sub_sa_name,
string.IsNullOrEmpty(prodSelect.operate_sub_sa_nick) ? "-" : prodSelect.operate_sub_sa_nick,
string.IsNullOrEmpty(prodSelect.operate_sub_sa_nick) ? "-" : prodSelect.operate_sub_sa_nick,
prodSelect.user_notes,
prodSelect.notes,
"编辑",
@@ -439,7 +439,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
}
}
private bool DeleteProduct(string dbId)
private bool DeleteProduct(string dbId, bool showErrMsg=true)
{
var url = BaseClass.BuildObjString("product_third/del_select_product");
var data = UserLogin.GetSignaturex() +
@@ -451,7 +451,8 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
BaseMsgForm.ShowError("删除商品失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
if (showErrMsg)
BaseMsgForm.ShowError("删除失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
return false;
}
return true;
@@ -597,7 +598,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
Invoke(new Action(() =>
{
row.Cells["colOpResult"].Value = "选品数据库商品已被清除";
if (temuDBProd?.id == 0)
if (temuDBProd?.id == 0)
row.Cells["colStatus"].Value = "已清除";
}));
continue;
@@ -676,7 +677,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
}));
}
}
Invoke(new Action(() =>
{
BaseMsgForm.ShowInfo("上传" + (this.chkUploadProd.Checked ? "" : "草稿") + "完成!");
@@ -801,7 +802,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
prodInfo.goodsAdvantageLabelVOList : new List<object>();
prodParam.goodsLayerDecorationCustomizeI18nReqs = prodInfo.goodsLayerDecorationCustomizeI18nVOList;
prodParam.goodsLayerDecorationReqs = new List<GoodsLayerDecorationReqsItem>();
foreach (var goodsLayerDecorationVOInfo in (prodInfo.goodsLayerDecorationVOList == null ?
foreach (var goodsLayerDecorationVOInfo in (prodInfo.goodsLayerDecorationVOList == null ?
new List<TemuGoodsLayerDecorationVO>() : prodInfo.goodsLayerDecorationVOList))
{
var goodsLayerDecorationItem = new GoodsLayerDecorationReqsItem()
@@ -1404,6 +1405,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
private void chkShowDel_CheckedChanged(object sender, EventArgs e)
{
dgvSelectProduct.Columns["colDelete"].Visible = this.chkShowDel.Checked;
btnDel.Visible = this.chkShowDel.Checked;
}
private void btnReFission_Click(object sender, EventArgs e)
@@ -1574,5 +1576,33 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
string centerWords = ",";
return (headWords + prod.product_name + centerWords + endWords).Trim(',');
}
private void btnDel_Click(object sender, EventArgs e)
{
if (BaseMsgForm.ShowConfirm("确定删除库存商品吗?删除后不可恢复!").DialogResult == DialogResult.Cancel)
return;
pbLoading.Visible = true;
var dbIds = dgvSelectProduct.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true)
.Select(r => r.Cells["colSelectId"].Value.ParseToString());
Task.Run(() =>
{
foreach (var dbId in dbIds)
{
Thread.Sleep(50);
var rst = DeleteProduct(dbId, false);
if (rst == false)
{
Invoke(new Action(() =>
{
BaseMsgForm.ShowError("数据删除失败,请稍后重试!");
}));
break;
}
};
SearchDbProdSelect(this.ucSplitPage1.CurrentPage);
});
}
}
}