调整函数,支持按份数批量打印
This commit is contained in:
@@ -213,9 +213,10 @@ namespace Tnb.WarehouseMgr
|
||||
/// 条码打印
|
||||
/// </summary>
|
||||
/// <param name="barCodes">条码</param>
|
||||
/// <param name="copies">打印份数</param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
protected void BarCodePrint(List<string> barCodes)
|
||||
protected void BarCodePrint(List<string> barCodes,int copies)
|
||||
{
|
||||
TaskCompletionSource tcs = new();
|
||||
// open port.
|
||||
@@ -308,18 +309,21 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
foreach (string code in barCodes)
|
||||
{
|
||||
//print text, true type text.
|
||||
_ = PPLBUtility.B_Prn_Text(200, 50, 0, 2, 2, 2, 'N', code);
|
||||
//barcode.
|
||||
_ = PPLBUtility.B_Prn_Barcode(50, 100, 0, "1", 3, 5, 70, 'B', code);//have a counter
|
||||
// output.
|
||||
_ = PPLBUtility.B_Print_Out(1);// copy 2.
|
||||
for (int i = 0; i < copies; i++)
|
||||
{
|
||||
//print text, true type text.
|
||||
_ = PPLBUtility.B_Prn_Text(150, 50, 0, 2, 2, 2, 'N', code);
|
||||
//barcode.
|
||||
_ = PPLBUtility.B_Prn_Barcode(50, 100, 0, "1", 3, 5, 70, 'N', code);//have a counter
|
||||
// output.
|
||||
_ = PPLBUtility.B_Print_Out(1);// copy 2.
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.SetException(ex);
|
||||
JNPF.Logging.Log.Error("条码打印时出现错误", ex);
|
||||
Logger.Error("条码打印时出现错误", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user