管理员与OEM增加 修改用户的同步物流金额

This commit is contained in:
chfei committed 2026-09-23 14:46:55 +08:00
1 parent 90dbd7fedc
commit fe9bad9983
6 files changed
+2754 -2324

No files matched your search

@@ -186,6 +186,7 @@ namespace TemuKJD.WXForms.AdminForms
user.postage_per_order = BaseRegex.GetDecimalJson(ref oStr, "postage_per_order");
user.refund_postage_per_order = BaseRegex.GetDecimalJson(ref oStr, "refund_postage_per_order");
user.gift_oem_amount_per_order = BaseRegex.GetDecimalJson(ref oStr, "gift_oem_amount_per_order");
user.sync_logistics_per_order = BaseRegex.GetDecimalJson(ref oStr, "sync_logistics_per_order");
user.oem_id = BaseRegex.GetStringJson(ref oStr, "oem_id");
user.oem_name = BaseRegex.GetStringJson(ref oStr, "oem_name");
var parent_user_name = BaseRegex.GetStringJson(ref oStr, "parent_user_name");
@@ -218,6 +219,8 @@ namespace TemuKJD.WXForms.AdminForms
(user.group_id == "3") ? "改" : null,
Math.Max(0m, user.gift_oem_amount_per_order.ParseToDecimal()),
(user.group_id == "3") ? "改" : null,
Math.Max(0m, user.sync_logistics_per_order.ParseToDecimal()),
(user.group_id == "3") ? "改" : null,
user.group_id == "3" ? "添加店铺" : "",
"编辑",
"删除");
@@ -288,6 +291,7 @@ namespace TemuKJD.WXForms.AdminForms
decimal postagePerOrder = dgvUser.Rows[e.RowIndex].Cells["colPostagePerOrder"].Value.ParseToDecimal();
decimal refundPostagePerOrder = dgvUser.Rows[e.RowIndex].Cells["colRefundPostagePerOrder"].Value.ParseToDecimal();
decimal giftOemAmountPerOrder = dgvUser.Rows[e.RowIndex].Cells["colGiftOemAmountPerOrder"].Value.ParseToDecimal();
decimal syncLogisticsPerOrder = dgvUser.Rows[e.RowIndex].Cells["colSyncLogisticsPerOrder"].Value.ParseToDecimal();
string oemId = dgvUser.Rows[e.RowIndex].Cells["colOemId"].Value.ParseToString();
var row = dgvUser.Rows[e.RowIndex];
if (columText == "编辑")
@@ -402,6 +406,16 @@ namespace TemuKJD.WXForms.AdminForms
this.pnlGiftOemAmountPerOrder.BringToFront();
this.lblGiftOemAmountPerOrderUserId.Text = uid;
}
if (columName == "colChangeSyncLogisticsPerOrder")
{
this.lblSyncLogisticsPerOrderUserInfo.Text = mobile + " - " + nickName;
this.numSyncLogisticsPerOrder.Value = syncLogisticsPerOrder;
this.pnlSyncLogisticsPerOrder.Tag = row;
this.pnlSyncLogisticsPerOrder.Visible = true;
this.pnlSyncLogisticsPerOrder.BringToFront();
this.lblSyncLogisticsPerOrderUserId.Text = uid;
}
}
}
@@ -446,6 +460,7 @@ namespace TemuKJD.WXForms.AdminForms
pnlPostagePerOrder.Location = new Point(pnlTopUp.Location.X, pnlTopUp.Location.Y);
pnlRefundPostagePerOrder.Location = new Point(pnlTopUp.Location.X, pnlTopUp.Location.Y);
pnlGiftOemAmountPerOrder.Location = new Point(pnlTopUp.Location.X, pnlTopUp.Location.Y);
pnlSyncLogisticsPerOrder.Location = new Point(pnlTopUp.Location.X, pnlTopUp.Location.Y);
this.cmbGroup.Items.Clear();
this.cmbGroup.Items.Add("主账户");
@@ -739,5 +754,42 @@ namespace TemuKJD.WXForms.AdminForms
{
pnlGiftOemAmountPerOrder.Visible = false;
}
private void btnSyncLogisticsPerOrder_Click(object sender, EventArgs e)
{
if (updateSyncLogisticsPerOrder(lblSyncLogisticsPerOrderUserId.Text))
{
pnlSyncLogisticsPerOrder.Visible = false;
BaseMsgForm.ShowInfo("修改同步物流额外金额成功");
}
}
public bool updateSyncLogisticsPerOrder(string userDbId, bool showFailBox = true)
{
string url = BaseClass.BuildObjString("user/update_user");
string data = UserLogin.GetSignaturex();
data += "&id=" + userDbId;
data += "&sync_logistics_per_order=" + numSyncLogisticsPerOrder.Value;
string html = GetHtml.PostUtf8(url, data.ToString()).Trim();
if (!html.Contains("\"code\":200"))
{
var msg = BaseRegex.GetStringJsonByRegs(ref html, html, "msg");
if (showFailBox)
{
Invoke(new Action(() => { BaseMsgForm.ShowError(msg); }));
}
return false;
}
var row = dgvUser.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["UserIdColumn"].Value.ParseToString() == userDbId);
if (row != null)
{
Invoke(new Action(() => { row.Cells["colSyncLogisticsPerOrder"].Value = numSyncLogisticsPerOrder.Value; }));
}
return true;
}
private void btnSyncLogisticsPerOrderCancel_Click(object sender, EventArgs e)
{
pnlSyncLogisticsPerOrder.Visible = false;
}
}
}