|
|
|
@ -9,6 +9,7 @@ using CommunityToolkit.Mvvm.Input;
|
|
|
|
|
using CommunityToolkit.Mvvm.Messaging;
|
|
|
|
|
using log4net;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using NPOI.Util;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
@ -164,7 +165,7 @@ namespace Aucma.Core.PrintTo.ViewModels
|
|
|
|
|
/// 打印
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private void Print(string obj)
|
|
|
|
|
private async void Print(string obj)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(obj))
|
|
|
|
|
{
|
|
|
|
@ -184,7 +185,7 @@ namespace Aucma.Core.PrintTo.ViewModels
|
|
|
|
|
}
|
|
|
|
|
if (SelectedCells.PlanAmount < PrintAmount)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("打印数量能高于计划数量!", "系统提醒");
|
|
|
|
|
MessageBox.Show("打印数量不能高于计划数量!", "系统提醒");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (printType==0)
|
|
|
|
@ -193,6 +194,7 @@ namespace Aucma.Core.PrintTo.ViewModels
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string order_code = SelectedCells.OrderCode;
|
|
|
|
@ -202,8 +204,34 @@ namespace Aucma.Core.PrintTo.ViewModels
|
|
|
|
|
//string material_name = SelectedCells.MaterialName;
|
|
|
|
|
int standard_amount = PrintAmount;
|
|
|
|
|
string printName = SelectedCells.PrintName;
|
|
|
|
|
|
|
|
|
|
PrintIsEnabled = "False";
|
|
|
|
|
int type = 0;
|
|
|
|
|
if (printType == 500)
|
|
|
|
|
{
|
|
|
|
|
type = 2;
|
|
|
|
|
}
|
|
|
|
|
if (printType == 200)
|
|
|
|
|
{
|
|
|
|
|
type = 1;
|
|
|
|
|
}
|
|
|
|
|
var list= await _printBarCodeServices.QueryAsync(d => d.OrderCode == order_code&&d.PrintBarType== printType);
|
|
|
|
|
|
|
|
|
|
if (list!=null||list.Count!= 0)
|
|
|
|
|
{
|
|
|
|
|
int num= list.Count;//已经打印数量
|
|
|
|
|
int residue= SelectedCells.PlanAmount - num;//剩余打印数量
|
|
|
|
|
if (residue == standard_amount)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("订单数量已经打印到规定订单数量!", "系统提醒");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ((residue- standard_amount)< 1)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("订单数量已经打印到规定订单数量!", "系统提醒");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新打印名称
|
|
|
|
|
var baseOrder = _baseOrderInfoServices.FirstAsync(d => d.OrderCode == order_code).Result;
|
|
|
|
|
if (string.IsNullOrEmpty(baseOrder.PrintName))
|
|
|
|
|