Tz2/Assets/Zion/Scripts/ERP/到货验收/DisplayStockCertificateList.cs

270 lines
9.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using DefaultNamespace;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using static InterfaceManager;
using DefaultNamespace.ProcessMode;
using MotionFramework;
public class DisplayStockCertificateList : MonoBehaviour
{
/// <summary>
/// 批次号
/// </summary>
public InputField batchNumberDisplayStockCertificateList;
/// <summary>
/// 查询
/// </summary>
public Button queryDisplayStockCertificateList;
/// <summary>
/// 表格化
/// </summary>
public Button tableDisplayStockCertificateList;
/// <summary>
/// 面板1
/// </summary>
public Transform PanelDisplayStockCertificateListOne;
/// <summary>
/// 面板2
/// </summary>
public Transform PanelDisplayStockCertificateListTwo;
/// <summary>
/// 面板3
/// </summary>
public Transform PanelDisplayStockCertificateListThree;
/// <summary>
/// 文件信息面板
/// </summary>
public Transform PanelFileInformation;
/// <summary>
/// 移动类型文本
/// </summary>
[Header("移动类型文本")] public List<Button> BtnForms = new List<Button>();
/// <summary>
/// 移动类型
/// </summary>
[Header("移动类型")] public List<TMP_InputField> InputMovementTypes = new List<TMP_InputField>();
/// <summary>
/// 移动类型文本
/// </summary>
[Header("移动类型文本")] public List<TMP_InputField> InputMovementTypesTexts = new List<TMP_InputField>();
/// <summary>
/// 物料凭证
/// </summary>
[Header("物料凭证")] public List<TMP_InputField> InputMaterialCertificates = new List<TMP_InputField>();
/// <summary>
/// 数量
/// </summary>
[Header("数量")] public List<TMP_InputField> InputQuantities = new List<TMP_InputField>();
/// <summary>
/// 凭证日期
/// </summary>
[Header("凭证日期")] public List<TMP_InputField> InputCertificateDates = new List<TMP_InputField>();
/// <summary>
/// 过账日期
/// </summary>
[Header("过账日期")] public List<TMP_InputField> InputPostingDates = new List<TMP_InputField>();
/// <summary>
/// 创建日期
/// </summary>
[Header("创建日期")] public List<TMP_InputField> InputCreationDates = new List<TMP_InputField>();
/// <summary>
/// 创建 时分秒
/// </summary>
[Header("创建 时分秒")] public List<TMP_InputField> InputCreationTimes = new List<TMP_InputField>();
/// <summary>
/// 显示
/// </summary>
public TextMeshProUGUI InputMaterialNameDisplayStock;
/// <summary>
/// 数量
/// </summary>
public TMP_InputField InputQuantitieDisplayStock;
/// <summary>
/// 移动类型
/// </summary>
public TMP_InputField InputMovementTypeDisplayStock;
/// <summary>
/// 凭证日期
/// </summary>
public TextMeshProUGUI InputCertificateDateDisplayStock;
/// <summary>
/// 过账日期
/// </summary>
public TextMeshProUGUI InputPostingDateDisplayStock;
/// <summary>
/// 创建日期
/// </summary>
public TextMeshProUGUI CreationDateYearMonthDay;
/// <summary>
/// 创建日期 时分秒
/// </summary>
public TextMeshProUGUI HourMinuteSecond;
/// <summary>
/// 确定按钮
/// </summary>
public Button BtnConfirmDisplayStock;
/// <summary>
/// 文件信息按钮
/// </summary>
public Button BtnPanelFileInformation;
/// <summary>
/// 物料凭证分析答题卡按钮
/// </summary>
public Button btnMaterialDocumentAnalysis;
public InputField gongchang;
private Framework.Dto.InventoryReversalVoucherAnalyzer returnRevVoucherAnalyzer;
public GameObject plane1;
public GameObject plane2;
public GameObject aaa;
void Start()
{
batchNumberDisplayStockCertificateList = FindObjectByName<InputField>("batchNumberDisplayStockCertificateList");
queryDisplayStockCertificateList = FindObjectByName<Button>("queryDisplayStockCertificateList");
tableDisplayStockCertificateList = FindObjectByName<Button>("tableDisplayStockCertificateList");
PanelDisplayStockCertificateListOne = FindObjectByName<Transform>("PanelDisplayStockCertificateListOne");
// PanelDisplayStockCertificateListTwo = FindObjectByName<Transform>("PanelDisplayStockCertificateListTwo");
PanelDisplayStockCertificateListThree = FindObjectByName<Transform>("PanelDisplayStockCertificateListThree");
btnMaterialDocumentAnalysis = FindObjectByName<Button>("btnMaterialDocumentAnalysis");
if (batchNumberDisplayStockCertificateList != null && queryDisplayStockCertificateList != null && tableDisplayStockCertificateList != null
&& PanelDisplayStockCertificateListOne != null )
{
queryDisplayStockCertificateList.onClick.AddListener(() =>
{
List<string> list = new List<string>();
list.Add(gongchang.text);
list.Add(batchNumberDisplayStockCertificateList.text);
// 你可以在这里调用其他方法来处理订单号
if (MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(list))
{
PanelDisplayStockCertificateListOne.gameObject.SetActive(true);
// if (btnMaterialDocumentAnalysis)
// btnMaterialDocumentAnalysis.gameObject.SetActive(true);
LoadTriggerNextGuide();
}
});
tableDisplayStockCertificateList.onClick.AddListener(() =>
{
if (returnRevVoucherAnalyzer.formselection == "2411H00032")
{
plane1.SetActive(true);
FileComponent.DownloadSingleFile("2411H00032凭证");
/// aaa.SetActive(true);
}
else
{
plane2.SetActive(true);
FileComponent.DownloadSingleFile("2410H03417凭证");
/// aaa.SetActive(true);
}
// PanelDisplayStockCertificateListTwo.gameObject.SetActive(true);
LoadTriggerNextGuide();
});
}
InputMaterialNameDisplayStock = FindObjectByName<TextMeshProUGUI>("InputMaterialNameDisplayStock");
InputQuantitieDisplayStock = FindObjectByName<TMP_InputField>("InputQuantitieDisplayStock");
InputMovementTypeDisplayStock = FindObjectByName<TMP_InputField>("InputMovementTypeDisplayStock");
BtnConfirmDisplayStock = FindObjectByName<Button>("BtnConfirmDisplayStock");
InputCertificateDateDisplayStock = FindObjectByName<TextMeshProUGUI>("InputCertificateDateDisplayStock");
InputPostingDateDisplayStock = FindObjectByName<TextMeshProUGUI>("InputPostingDateDisplayStock");
CreationDateYearMonthDay = FindObjectByName<TextMeshProUGUI>("CreationDateYearMonthDay");
HourMinuteSecond = FindObjectByName<TextMeshProUGUI>("HourMinuteSecond");
if (BtnConfirmDisplayStock != null && PanelDisplayStockCertificateListThree != null)
{
BtnConfirmDisplayStock.onClick.AddListener(() =>
{
PanelDisplayStockCertificateListThree.gameObject.SetActive(false);
LoadTriggerNextGuide("关闭");
MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick("显示库存凭证清单");
});
}
BtnPanelFileInformation = FindObjectByName<Button>("BtnPanelFileInformation");
PanelFileInformation = FindObjectByName<Transform>("PanelFileInformation");
if (BtnPanelFileInformation != null && PanelFileInformation != null)
{
BtnPanelFileInformation.onClick.AddListener(() =>
{
PanelFileInformation.gameObject.SetActive(true);
LoadTriggerNextGuide();
});
}
returnRevVoucherAnalyzer = (Framework.Dto.InventoryReversalVoucherAnalyzer)MotionEngine.GetModule<GlobalDataStorage>().materialTaskObj;
}
/// <summary>
/// 显示
/// </summary>
public void LoadPanelDisplayStockCertificateListThree(Button btn)
{
// if (returnRevVoucherAnalyzer.formselection == "2411H00032")
// {
//
// }
// else if (returnRevVoucherAnalyzer.formselection == "2410H03417")
// {
//
// }
//
int index = BtnForms.IndexOf(btn);
PanelDisplayStockCertificateListThree.gameObject.SetActive(true);
PanelFileInformation.gameObject.SetActive(false);
InputMaterialNameDisplayStock.text = "显示 物料凭证 " + InputMaterialCertificates[0].text + " - 杨丽";
InputCertificateDateDisplayStock.text = InputCertificateDates[0].text;
InputPostingDateDisplayStock.text = InputPostingDates[0].text;
InputQuantitieDisplayStock.text = InputQuantities[0].text;
InputMovementTypeDisplayStock.text = InputMovementTypes[0].text;
CreationDateYearMonthDay.text = InputCreationDates[0].text;
HourMinuteSecond.text = InputCreationTimes[0].text;
aaa.SetActive(false);
plane1.SetActive(false);
plane2.SetActive(false);
LoadTriggerNextGuide();
}
}