feat: 支持单位工程排序并统一委托单号生成与编辑

支持按业务序号展示单位工程,并使页面与 API 使用一致的委托单编号规则;允许有修改权限的用户调整委托单号。附带序号字段及修改按钮权限的数据库升级脚本。
This commit is contained in:
2026-10-14 15:13:10 +08:00
parent e00a3ddcf0
commit 0c7bf3c292
69 changed files with 252 additions and 105 deletions
@@ -38,6 +38,7 @@ namespace FineUIPro.Web.ProjectData
if (UnitWork != null)
{
this.ProjectId = UnitWork.ProjectId;
this.txtSerialNumber.Text = UnitWork.SerialNumber.ToString();
this.txtUnitWorkCode.Text = UnitWork.UnitWorkCode;
this.txtUnitWorkName.Text = UnitWork.UnitWorkName;
if (!string.IsNullOrEmpty(UnitWork.ProjectType))
@@ -90,6 +91,17 @@ namespace FineUIPro.Web.ProjectData
//}
string UnitWorkId = Request.Params["UnitWorkId"];
Model.WBS_UnitWork UnitWork = new Model.WBS_UnitWork();
string serialNumberText = this.txtSerialNumber.Text.Trim();
if (serialNumberText.Length > 0)
{
int serialNumber;
if (!int.TryParse(serialNumberText, out serialNumber) || serialNumber < 0)
{
Alert.ShowInTop("序号请输入0至2147483647之间的整数!", MessageBoxIcon.Warning);
return;
}
UnitWork.SerialNumber = serialNumber;
}
UnitWork.ProjectId = this.CurrUser.LoginProjectId;
UnitWork.UnitWorkCode = this.txtUnitWorkCode.Text.Trim();
UnitWork.UnitWorkName = this.txtUnitWorkName.Text.Trim();
@@ -148,6 +160,7 @@ namespace FineUIPro.Web.ProjectData
UnitWork.UnitWorkId = SQLHelper.GetNewID();
BLL.UnitWorkService.AddUnitWork(UnitWork);
}
Cache.Remove("UnitWorkTree_" + this.CurrUser.LoginProjectId);
ShowNotify("提交成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}