2024-12-02 15:02:39 +08:00
|
|
|
|
using DocumentFormat.OpenXml.Office2010.ExcelAc;
|
|
|
|
|
using Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace LeatherApp.Page
|
|
|
|
|
{
|
|
|
|
|
public partial class CuttingFrm : Form
|
|
|
|
|
{
|
|
|
|
|
public string[] Cut_info;
|
2024-12-18 10:44:17 +08:00
|
|
|
|
public CuttingFrm(List<DefectInfo> DefectInfoList)
|
2024-12-02 15:02:39 +08:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
2024-12-18 10:44:17 +08:00
|
|
|
|
this.comboBox2.SelectedIndex = 0;
|
2024-12-02 15:02:39 +08:00
|
|
|
|
//加载分卷信息
|
|
|
|
|
List<JDefectTotal> DefectTotal = null;
|
|
|
|
|
List<string> liststr = new List<string>();
|
2025-02-05 08:40:57 +08:00
|
|
|
|
if (Config.DownGradeReason != null && Config.DownGradeReason.Count > 0)
|
2024-12-02 15:02:39 +08:00
|
|
|
|
{
|
2025-02-05 08:40:57 +08:00
|
|
|
|
foreach (var item in Config.DownGradeReason)
|
2024-12-02 15:02:39 +08:00
|
|
|
|
{
|
2025-02-05 08:40:57 +08:00
|
|
|
|
liststr.Add($"{item.Key}{item.Value}");
|
2024-12-02 15:02:39 +08:00
|
|
|
|
}
|
2025-02-05 08:40:57 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
liststr.Add("无瑕疵人工裁切");
|
|
|
|
|
{
|
|
|
|
|
if (DefectInfoList != null && DefectInfoList.Count > 0)
|
2024-12-02 15:02:39 +08:00
|
|
|
|
{
|
2025-02-05 08:40:57 +08:00
|
|
|
|
var deflist = DefectInfoList;
|
|
|
|
|
DefectTotal = deflist.GroupBy(x => x.Name).Select(g => new JDefectTotal { Name = g.Key, Count = g.Count() }).ToList();
|
2024-12-02 15:02:39 +08:00
|
|
|
|
}
|
2025-02-05 08:40:57 +08:00
|
|
|
|
if (DefectTotal != null && DefectTotal.Count > 0)
|
|
|
|
|
foreach (var item in DefectTotal)
|
|
|
|
|
{
|
|
|
|
|
liststr.Add($"{item.Name}{item.Count}个");
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-02 15:02:39 +08:00
|
|
|
|
}
|
|
|
|
|
comboBox1.DataSource = liststr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void skinButton2_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.DialogResult = DialogResult.Cancel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void skinButton1_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if(numericUpDown1.Value == 0)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("请输入裁切米数!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (string.IsNullOrEmpty(textBox1.Text))
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("请裁切原因!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Cut_info = new string[3];
|
|
|
|
|
Cut_info[0] = numericUpDown1.Value.ToString();
|
|
|
|
|
Cut_info[1] = textBox1.Text;
|
2024-12-18 10:44:17 +08:00
|
|
|
|
Cut_info[2] = comboBox2.Text;
|
2024-12-02 15:02:39 +08:00
|
|
|
|
this.DialogResult = DialogResult.OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void skinButton3_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(textBox1.Text))
|
|
|
|
|
textBox1.Text += comboBox1.Text;
|
|
|
|
|
else
|
|
|
|
|
textBox1.Text += $",{comboBox1.Text}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class JDefectTotal
|
|
|
|
|
{
|
|
|
|
|
[Description("疵点名")]
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
[Description("疵点数")]
|
|
|
|
|
public int Count { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|