This commit is contained in:
PastSaid
2025-01-01 08:21:58 +08:00
parent 9725ab5376
commit 3d15fd4b7e
59 changed files with 3013 additions and 1324 deletions

View File

@@ -2,6 +2,8 @@
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
@@ -63,5 +65,35 @@ WHERE t0.FISCHECK = 1
}
}
public override void BeforeUpdateValue(BeforeUpdateValueEventArgs e)
{
base.BeforeUpdateValue(e);
if (e.Key.ToUpperInvariant().Equals("FAACVALUE"))
{
var barCode = e.Value.ToString();
var sqlL = $@"/*dialect*/
SELECT t0.FBARCODE,t0.FBillNo,t0.FBILLSEQ,t0.FBILLFORMID,t0.FLOT
FROM T_UNW_WMS_BARCODE t0
WHERE t0.FBARCODE = '{barCode}'
AND t0.FBILLFORMID = 'PRD_MO'
";
var dataList = DBServiceHelper.ExecuteDynamicObject(this.Context, sqlL);
if (dataList == null || dataList.Count == 0)
{
this.View.Model.SetValue("FverifyRes", "无效的二维码!");
this.View.GetControl("FverifyRes").SetCustomPropertyValue("ForeColor", "#FF3300");
}
else
{
}
e.Value = "";
var control = this.View.GetControl("FAACValue");
control.SetFocus();
e.Cancel = true;
}
}
}
}

View File

@@ -141,43 +141,35 @@ def ButtonClick(e):
def BeforeUpdateValue(e):
if str(e.Key).upper() == "FAACVALUE":
val = e.Value
isLong = val.find("_")
if isLong == -1:
barCode = e.Value
if barCode != "":
sqlL = """/*dialect*/
SELECT FBARCODE
FROM T_BD_BARCODEMAINEX t0
WHERE t0.FID = {0}
SELECT t0.FBARCODE,t0.FBillNo,t0.FBILLSEQ,t0.FBILLFORMID,t0.FLOT,t0.FLOT_TEXT,t1.FNUMBER
FROM T_UNW_WMS_BARCODE t0
INNER JOIN T_BD_FMATERIAL t1 on t0.FMATERIALID = t1.FMATERIALID
WHERE t0.FBARCODE = '{0}'
AND t0.FBILLFORMID = 'PRD_MO'
""".format(e.Value)
dataList = DBServiceHelper.ExecuteDynamicObject(this.Context, sqlL)
val = dataList[0]["FBARCODE"]
if val != "":
# raise Exception(JsonUtil.Serialize(this.View.Model.DataObject))
infoList = val.split("_")
flag = False;
entity = this.View.Model.DataObject["FEntity"]
# raise Exception(JsonUtil.Serialize(entity))
if infoList.Count < 3:
if dataList.Count == 0:
this.View.Model.SetValue("FverifyRes","无效的二维码!")
this.View.GetControl("FverifyRes").SetCustomPropertyValue("ForeColor", "#FF3300")
# this.View.Model.SetValue("FAACValue","");
this.View.UpdateView();
e.Value = "";
control = this.View.GetControl("FAACValue");
control.SetFocus();
e.Cancel = True;
return;
# raise Exception(JsonUtil.Serialize(this.View.Model.DataObject))
infoList = dataList[0]
flag = False;
entity = this.View.Model.DataObject["FEntity"]
materialNumber = infoList[0]
materialNumber = infoList["FNUMBER"]
# qty = float(0)
lot = ""
oTId = this.View.Model.DataObject["FObjectTypeId_Id"]
if oTId == "UHIK_PRD_PACKAGE_INSTOCK":
# qty = float(infoList[1])
lot = infoList[2]
lot = infoList["FLOT_TEXT"]
for idx, item in enumerate(entity):
# raise Exception(JsonUtil.Serialize(item))
entityNumber = item["FMaterialId"]["Number"]