更改日期属性类型并更新日期格式
在 `ExportModel.cs` 文件中: - 添加了 `MiniExcelLibs.Attributes` 和 `System` 的引用。 - 将 `OrderDate` 和 `DeliveryDate` 属性的数据类型从 `string` 改为 `DateTime`,并添加了 `ExcelColumn` 属性以指定日期格式为 "MM月dd日"。 在 `MainViewModel.cs` 文件中: - 修改了 `data.Model` 的格式字符串,将 "1x" 改为 "1×"。 - 将 `nowDateStr` 和 `nowDeliveryDateStr` 的初始化从字符串格式的日期改为 `DateTime` 类型,并注释掉了 `.ToString("yyyy-MM-dd")` 部分。
This commit is contained in:
parent
0ff6557251
commit
c387222d1f
|
@ -1,4 +1,7 @@
|
|||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
|
||||
using MiniExcelLibs.Attributes;
|
||||
using System;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
|
||||
{
|
||||
public class ExportModel
|
||||
{
|
||||
|
@ -143,12 +146,14 @@
|
|||
/// <summary>
|
||||
/// 下单日期
|
||||
/// </summary>
|
||||
public string OrderDate { get; set; }
|
||||
[ExcelColumn(Format = "MM月dd日")]
|
||||
public DateTime OrderDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交货日期
|
||||
/// </summary>
|
||||
public string DeliveryDate { get; set; }
|
||||
[ExcelColumn(Format = "MM月dd日")]
|
||||
public DateTime DeliveryDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否忽略异常
|
||||
|
|
|
@ -288,7 +288,7 @@ public partial class MainViewModel : INotifyPropertyChanged
|
|||
//data.WireNumber = item.Imprint;
|
||||
data.Quantity = 1;
|
||||
//"RV-"&A2&"-"&"1×"&J2&"-"&L2&"-"&"16×N2"&"-"&M2
|
||||
data.Model = $"RV-{data.WireColor}-1x{data.CrossSection}-{data.WireLength}-16×N2-{data.WireNumber}";
|
||||
data.Model = $"RV-{data.WireColor}-1×{data.CrossSection}-{data.WireLength}-16×N2-{data.WireNumber}";
|
||||
//data.IsChecked = true;
|
||||
if (!string.IsNullOrEmpty(data.DiscolorationDesc))
|
||||
{
|
||||
|
@ -483,8 +483,8 @@ public partial class MainViewModel : INotifyPropertyChanged
|
|||
ExportData = [];
|
||||
int seqNo = 1;
|
||||
var dataList = new List<ExportModel>();
|
||||
var nowDateStr = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
var nowDeliveryDateStr = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd");
|
||||
var nowDateStr = DateTime.Now;//.ToString("yyyy-MM-dd");
|
||||
var nowDeliveryDateStr = DateTime.Now.AddDays(7);//.ToString("yyyy-MM-dd");
|
||||
//foreach (var stuffedDataModel in StuffedData)
|
||||
StuffedData.AsParallel().WithDegreeOfParallelism(1).ForAll(stuffedDataModel =>
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue