步步为盈
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.5 KiB

2 years ago
using BBWY.Client.APIServices;
using BBWY.Client.Models;
using BBWY.Client.Models.APIModel.Request;
2 years ago
using BBWY.Controls;
2 years ago
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// SetBarCode.xaml 的交互逻辑
/// </summary>
public partial class SetBarCodeWindow : BWindow
{
2 years ago
public SetBarCodeWindow()
2 years ago
{
InitializeComponent();
2 years ago
2 years ago
}
2 years ago
public void LoadData(BarCodeModel barCodeModel,PackTaskService PackTaskService)
{
BarCodeModel = barCodeModel; packTaskService = PackTaskService;
this.DataContext = this;
}
public BarCodeModel BarCodeModel { get; set; }
public PackTaskService packTaskService { get; set; }
public Action<BarCodeModel> SaveResult { get; set; }
private void BButton_Click(object sender, RoutedEventArgs e)
{
if (BarCodeModel.LabelModel == BarcodeLabelModel.)//标准版 判断数据是否异常
{
if (string.IsNullOrEmpty(BarCodeModel.ProductNo) || BarCodeModel.ProductNo == "待填写")
{
TipsWindow tips = new TipsWindow("该SKU无货号信息,将影响条形码打印\r\n请先设置好货号信息或调整打印模板类型");
tips.Show();
return;
}
}
//保存到服务器中 返回id
var resData = packTaskService.SaveBarCode(new BarCodeRequest
{
Brand = BarCodeModel.Brand,
BrandName = BarCodeModel.BrandName,
ProductNo = BarCodeModel.ProductNo,
SkuId = BarCodeModel.SkuId,
SkuName = BarCodeModel.SkuName,
LabelModel = BarCodeModel.LabelModel
});
if (resData == null || !resData.Success)
{
//IsSetBarCode = false;
return;
}
BarCodeModel.Id = resData.Data;
if (SaveResult != null)
SaveResult(BarCodeModel);
// IsNeedBarCode = "需要";
//IsSetBarCode = false;
// setBarCodeWindow.Close();
this.Close();
}
2 years ago
}
}