using System.Collections; using System.Collections.Generic; using DefaultNamespace; using DefaultNamespace.ProcessMode; using Framework.Manager; using MotionFramework; using TMPro; using UnityEngine; using UnityEngine.UI; /// /// 调拨单据签字签章查询 /// public class TransferDocumentSignatureQueryManager : MonoBehaviour { public Toggle[] toggles; public Button plane1Button; public GameObject plane1; public GameObject plane2; public GameObject plane3; public GameObject plane4; // 调拨令生成按钮 public Button transferOrderGenerateButton; // 转储订单生成按钮 public Button transferDumpOrderGenerateButton; // 调拨单生成按钮 public Button transferDocumentGenerateButton; public Button plane4GenerateButton; public Image Image1; public Image Image2; public Image Image3; public TMP_InputField[] 物料编码; public TMP_InputField[] 调拨数量; public TMP_InputField[] 物料名称; public TMP_InputField[] 单位; // public GameObject game1; public Dropdown dropdown; public Dropdown dropdown2; public Dropdown dropdown3; public Button chaxun; public Button chaxun2; public Button chaxun3; void Start() { chaxun3.onClick.AddListener(delegate { int index = dropdown3.value; if (index == 0) { plane2.SetActive(true); plane3.SetActive(false); plane4.SetActive(false); TutorialGuideManager.Instance.TriggerNextGuide(); } else if (index == 1) { plane2.SetActive(false); plane4.SetActive(false); plane3.SetActive(true); TutorialGuideManager.Instance.TriggerNextGuide(); } else if (index == 2) { plane2.SetActive(false); plane3.SetActive(false); plane4.SetActive(true); TutorialGuideManager.Instance.TriggerNextGuide(); } }); chaxun2.onClick.AddListener(delegate { int index = dropdown2.value; if (index == 0) { plane2.SetActive(true); plane3.SetActive(false); plane4.SetActive(false); TutorialGuideManager.Instance.TriggerNextGuide(); } else if (index == 1) { plane2.SetActive(false); plane4.SetActive(false); plane3.SetActive(true); TutorialGuideManager.Instance.TriggerNextGuide(); } else if (index == 2) { plane2.SetActive(false); plane3.SetActive(false); plane4.SetActive(true); TutorialGuideManager.Instance.TriggerNextGuide(); } }); chaxun.onClick.AddListener(delegate { int index = dropdown.value; if (index == 0) { plane2.SetActive(true); plane3.SetActive(false); plane4.SetActive(false); TutorialGuideManager.Instance.TriggerNextGuide(); } else if (index == 1) { plane2.SetActive(false); plane4.SetActive(false); plane3.SetActive(true); TutorialGuideManager.Instance.TriggerNextGuide(); } else if (index == 2) { plane2.SetActive(false); plane3.SetActive(false); plane4.SetActive(true); TutorialGuideManager.Instance.TriggerNextGuide(); } }); plane1Button.onClick.AddListener(delegate { // GenerateTransferOrder(); plane1.SetActive(false); // game1.SetActive(true); plane2.SetActive(true); TutorialGuideManager.Instance.TriggerNextGuide(); }); // 为调拨令生成按钮添加点击事件监听器 if (transferOrderGenerateButton != null) { transferOrderGenerateButton.onClick.AddListener(GenerateTransferOrder); } // 为转储订单生成按钮添加点击事件监听器 if (transferDumpOrderGenerateButton != null) { transferDumpOrderGenerateButton.onClick.AddListener(GenerateTransferDumpOrder); } // 为调拨单生成按钮添加点击事件监听器 if (transferDocumentGenerateButton != null) { transferDocumentGenerateButton.onClick.AddListener(GenerateTransferDocument); } // var globalData = MotionEngine.GetModule(); // // for (int i = 0; i < 物料编码.Length; i++) // { // 物料编码[i].text = globalData.GetTaskBookValue("物料编码"); // } // // for (int i = 0; i < 调拨数量.Length; i++) // { // 调拨数量[i].text = globalData.GetTaskBookValue("调拨数量"); // } // // for (int i = 0; i < 物料名称.Length; i++) // { // 物料名称[i].text = globalData.GetTaskBookValue("物料名称"); // } // // for (int i = 0; i < 单位.Length; i++) // { // 单位[i].text = globalData.GetTaskBookValue("单位"); // } } // 检查是否有 Toggle 被选中 bool IsAnyToggleOn() { if (toggles != null) { foreach (Toggle toggle in toggles) { if (toggle != null && toggle.isOn) { return true; } } } return false; } // 生成调拨令的方法 //补充下载文件 void GenerateTransferOrder() { Debug.Log("下载接收方调拨申请单"); if (dropdown3.value == 2) MotionEngine.GetModule().HandleClick("下载调拨令"); else { MotionEngine.GetModule().HandleClick("点击错误"); } Image1.gameObject.SetActive(true); TutorialGuideManager.Instance.TriggerNextGuide(); } // 生成转储订单的方法 void GenerateTransferDumpOrder() { Debug.Log("生成调拨令"); if (dropdown3.value == 2) MotionEngine.GetModule().HandleClick("下载转储订单"); else { MotionEngine.GetModule().HandleClick("点击错误"); } Image2.gameObject.SetActive(true); TutorialGuideManager.Instance.TriggerNextGuide(); } // 生成调拨单的方法 void GenerateTransferDocument() { Debug.Log("下载转储订单"); if (dropdown.value == 1) MotionEngine.GetModule().HandleClick("下载接收方调拨申请单"); else { MotionEngine.GetModule().HandleClick("点击错误"); } Image3.gameObject.SetActive(true); TutorialGuideManager.Instance.TriggerNextGuide(); } }