散件出库

This commit is contained in:
2025-01-24 09:13:53 +08:00
parent 1ce9e37872
commit 553defbc94
3 changed files with 30 additions and 3 deletions
+24 -1
View File
@@ -599,7 +599,7 @@ namespace BLL
} }
public static string GetDataInCusBillCode(string projectid, string unitcode,string typeString) public static string GetDataInCusBillCode(string projectid, string unitcode,string typeString,string unitWorkCode="",string Category = "")
{ {
if (typeString == TwConst.TypeInt.退.ToString()) if (typeString == TwConst.TypeInt.退.ToString())
{ {
@@ -614,6 +614,29 @@ namespace BLL
cusBillCode = cusBillCode + (queryAllresult + 1).ToString().PadLeft(2, '0'); cusBillCode = cusBillCode + (queryAllresult + 1).ToString().PadLeft(2, '0');
return cusBillCode; return cusBillCode;
} }
else if (typeString == TwConst.TypeInt..ToString())
{
//生成规则是20240919-unitcode-AP-GR01
string cusBillCode = string.Format("{0:yyyyMMdd}", DateTime.Now) + unitcode+"-" + unitWorkCode +"-";
var queryAll = new Tw_InOutMasterOutput()
{
ProjectId = projectid,
CusBillCode = cusBillCode,
Category = Category == TwConst.Category..ToString() ? (int)TwConst.Category. : (int)TwConst.Category.
};
var queryAllresult = GetModle(queryAll).Count();
if (Category == TwConst.Category..ToString())
{
cusBillCode = cusBillCode + (queryAllresult + 1).ToString().PadLeft(2, '0') + "-GI-P01";
}
else
{
cusBillCode = cusBillCode + (queryAllresult + 1).ToString().PadLeft(2, '0') + "-GI-PF01";
}
return cusBillCode;
}
else else
{ {
//生成规则是20240919-unitcode-AP-GR01 //生成规则是20240919-unitcode-AP-GR01
@@ -45,7 +45,7 @@
<f:DropDownList ID="drpTypeInt" runat="server" Label="类型" ColumnWidth="20%" OnSelectedIndexChanged="drpTypeInt_SelectedIndexChanged" AutoPostBack="true" <f:DropDownList ID="drpTypeInt" runat="server" Label="类型" ColumnWidth="20%" OnSelectedIndexChanged="drpTypeInt_SelectedIndexChanged" AutoPostBack="true"
LabelWidth="70px" LabelAlign="Right" Width="170px"> LabelWidth="70px" LabelAlign="Right" Width="170px">
</f:DropDownList> </f:DropDownList>
<f:DropDownList ID="drpCategory" runat="server" Label="类别" ColumnWidth="30%" <f:DropDownList ID="drpCategory" runat="server" Label="类别" ColumnWidth="30%" OnSelectedIndexChanged="drpTypeInt_SelectedIndexChanged" AutoPostBack="true"
LabelWidth="70px" LabelAlign="Right" Width="170px"> LabelWidth="70px" LabelAlign="Right" Width="170px">
</f:DropDownList> </f:DropDownList>
<f:TextBox ID="txtCusBillCode" Label="编号" ColumnWidth="30%" runat="server" ShowRedStar="true" Required="true"> <f:TextBox ID="txtCusBillCode" Label="编号" ColumnWidth="30%" runat="server" ShowRedStar="true" Required="true">
@@ -85,7 +85,7 @@ namespace FineUIPro.Web.CLGL
txtCreateMan.Text = this.CurrUser.PersonName; txtCreateMan.Text = this.CurrUser.PersonName;
txtCreateDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); txtCreateDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
drpReqUnit.SelectedValue = this.CurrUser.UnitId; drpReqUnit.SelectedValue = this.CurrUser.UnitId;
txtCusBillCode.Text = TwInOutplanmasterService.GetDataInCusBillCode(this.CurrUser.LoginProjectId, UnitService.GetUnitByUnitId(this.CurrUser.UnitId)?.UnitCode, drpTypeInt.SelectedText); txtCusBillCode.Text = TwInOutplanmasterService.GetDataInCusBillCode(this.CurrUser.LoginProjectId, UnitService.GetUnitByUnitId(drpReqUnit.SelectedValue)?.UnitCode, UnitWorkService.getUnitWorkByUnitWorkId(UnitWorkId)?.UnitWorkCode,drpTypeInt.SelectedText, drpCategory.SelectedText);
} }
drpTypeInt_SelectedIndexChanged(null, null); drpTypeInt_SelectedIndexChanged(null, null);
@@ -302,6 +302,10 @@ namespace FineUIPro.Web.CLGL
protected void drpTypeInt_SelectedIndexChanged(object sender, EventArgs e) protected void drpTypeInt_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (string.IsNullOrEmpty(Id))
{
txtCusBillCode.Text = TwInOutplanmasterService.GetDataInCusBillCode(this.CurrUser.LoginProjectId, UnitService.GetUnitByUnitId(drpReqUnit.SelectedValue)?.UnitCode, drpTypeInt.SelectedText, UnitWorkService.getUnitWorkByUnitWorkId(UnitWorkId)?.UnitWorkCode, drpCategory.SelectedText);
}
if (drpTypeInt.SelectedValue ==((int)TwConst.TypeInt.).ToString()) if (drpTypeInt.SelectedValue ==((int)TwConst.TypeInt.).ToString())
{ {
Grid1.Hidden=false; Grid1.Hidden=false;