115 lines
3.4 KiB
C#
115 lines
3.4 KiB
C#
using DefaultNamespace.ProcessMode;
|
|
using Framework.Manager;
|
|
using MotionFramework;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
/// <summary>
|
|
/// 库存物资报废流程
|
|
/// </summary>
|
|
public class InventoryScrapProcessManager : MonoBehaviour
|
|
{
|
|
public TMP_Dropdown _dropdown;
|
|
public TMP_InputField movementTypeInput; // 移动类型输入框
|
|
public TMP_InputField materialInput; // 物料输入框
|
|
public TMP_InputField shuliang;
|
|
public TMP_InputField kucundidian;
|
|
public TMP_InputField batchInput; // 批次输入框
|
|
public TMP_InputField gongchang;
|
|
public TMP_InputField[] ins;
|
|
public Button checkInventoryButton; // 管理库存收发货检查按钮
|
|
public Button postInventoryButton; // 管理库存收发货过账按钮
|
|
|
|
public bool isB = false;
|
|
public GameObject messageBox;
|
|
private void Start()
|
|
{
|
|
// 为 movementTypeInput 添加输入事件监听
|
|
movementTypeInput.onValueChanged.AddListener(OnMovementTypeInputChanged);
|
|
// 为管理库存收发货检查按钮添加点击事件监听
|
|
checkInventoryButton.onClick.AddListener(OnCheckInventoryButtonClicked);
|
|
// 为管理库存收发货过账按钮添加点击事件监听
|
|
postInventoryButton.onClick.AddListener(OnPostInventoryButtonClicked);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 处理移动类型输入框内容变化事件
|
|
/// </summary>
|
|
/// <param name="inputValue">输入框当前的值</param>
|
|
private void OnMovementTypeInputChanged(string inputValue)
|
|
{
|
|
// 当输入内容为 Z11 时
|
|
|
|
// 遍历 ins 数组,将每个输入框的 text 设置为 Z11
|
|
foreach (var inputField in ins)
|
|
{
|
|
if (inputField != null)
|
|
{
|
|
inputField.text = inputValue;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 处理管理库存收发货检查按钮点击事件
|
|
/// </summary>
|
|
private void OnCheckInventoryButtonClicked()
|
|
{
|
|
// 这里添加管理库存收发货检查的逻辑
|
|
Debug.Log("管理库存收发货检查按钮被点击");
|
|
|
|
|
|
List<string> list = new List<string>();
|
|
string selectedText = _dropdown.options[_dropdown.value].text;
|
|
list.Add(selectedText);
|
|
list.Add(movementTypeInput.text);
|
|
list.Add(materialInput.text);
|
|
list.Add(shuliang.text);
|
|
list.Add(kucundidian.text);
|
|
list.Add(batchInput.text);
|
|
list.Add(gongchang.text);
|
|
|
|
if (MotionEngine.GetModule<ProcessManager>().HandleClick(list))
|
|
{
|
|
|
|
|
|
TutorialGuideManager.Instance.TriggerNextGuide();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 处理管理库存收发货过账按钮点击事件
|
|
/// </summary>
|
|
private void OnPostInventoryButtonClicked()
|
|
{
|
|
// 这里添加管理库存收发货过账的逻辑
|
|
Debug.Log("管理库存收发货过账按钮被点击");
|
|
MotionEngine.GetModule<ProcessManager>().HandleClick("过账");
|
|
|
|
if (isB)
|
|
{
|
|
messageBox.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
isB = true;
|
|
|
|
}
|
|
movementTypeInput.text = "";
|
|
materialInput.text = "";
|
|
shuliang.text = "";
|
|
kucundidian.text = "";
|
|
batchInput.text = "";
|
|
gongchang.text = "";
|
|
|
|
|
|
TutorialGuideManager.Instance.TriggerNextGuide();
|
|
}
|
|
}
|