107 lines
3.7 KiB
C#
107 lines
3.7 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using DefaultNamespace;
|
||
using DefaultNamespace.ProcessMode;
|
||
using Framework.Manager;
|
||
using MotionFramework;
|
||
using TMPro;
|
||
using UnityEngine;
|
||
using UnityEngine.UI;
|
||
|
||
namespace Zion.Scripts.ERP.公司库存组成分析
|
||
{
|
||
/// <summary>
|
||
/// /公司库存组成分析
|
||
/// </summary>
|
||
public class InventoryMaterialQueryReportManager : MonoBehaviour
|
||
{
|
||
[SerializeField] private Button _button;
|
||
[SerializeField] private Button _saveButton;
|
||
[SerializeField] private TMP_InputField _factoryInputField;
|
||
[SerializeField] private TMP_InputField _locationInputField;
|
||
|
||
|
||
public GameObject plane1;
|
||
|
||
private Framework.Dto.InventoryReversalVoucherAnalyzer inventoryReversalVoucherAnalyzer;
|
||
|
||
|
||
public GameObject plane2;
|
||
|
||
public Button b1;
|
||
public Button b2;
|
||
|
||
|
||
public void DownFile()
|
||
{
|
||
}
|
||
|
||
private void Start()
|
||
{
|
||
Debug.Log("[InventoryMaterialQueryReportManager] Start方法被调用,初始化组件");
|
||
|
||
_button.onClick.AddListener(QueryData);
|
||
_saveButton.onClick.AddListener(OnSave);
|
||
inventoryReversalVoucherAnalyzer = (Framework.Dto.InventoryReversalVoucherAnalyzer)MotionEngine.GetModule<GlobalDataStorage>().materialTaskObj;
|
||
|
||
b1.onClick.AddListener(OnSave);
|
||
b2.onClick.AddListener(OnSave);
|
||
|
||
Debug.Log($"[InventoryMaterialQueryReportManager] 初始化完成,materialTaskObj获取成功: {inventoryReversalVoucherAnalyzer != null}");
|
||
}
|
||
|
||
|
||
private void OnRightClick()
|
||
{
|
||
TutorialGuideManager.Instance.TriggerNextGuide();
|
||
}
|
||
|
||
private void OnSave()
|
||
{
|
||
Debug.Log("[InventoryMaterialQueryReportManager] OnSave方法被调用");
|
||
|
||
if (MotionEngine.GetModule<ProcessManager>().HandleClick("保存"))
|
||
{
|
||
if (inventoryReversalVoucherAnalyzer.formselection == "全市库存表1")
|
||
{
|
||
Debug.Log("[InventoryMaterialQueryReportManager] 下载库存表1文件");
|
||
FileComponent.DownloadSingleFile("附件1:公司库存组成分析--全市库存表1");
|
||
}
|
||
else
|
||
{
|
||
Debug.Log("[InventoryMaterialQueryReportManager] 下载库存表2文件");
|
||
FileComponent.DownloadSingleFile("附件1:公司库存组成分析--全市库存表2");
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
private void QueryData()
|
||
{
|
||
Debug.Log($"[InventoryMaterialQueryReportManager] QueryData方法被调用,工厂代码: {_factoryInputField.text}, 库存地点: {_locationInputField.text}");
|
||
|
||
if (MotionEngine.GetModule<ProcessManager>().HandleClick(new List<string>()
|
||
{
|
||
_factoryInputField.text,
|
||
_locationInputField.text
|
||
}))
|
||
{
|
||
Debug.Log($"[InventoryMaterialQueryReportManager] formselection值: {inventoryReversalVoucherAnalyzer.formselection}");
|
||
|
||
if (inventoryReversalVoucherAnalyzer.formselection == "全市库存表1")
|
||
{
|
||
Debug.Log("[InventoryMaterialQueryReportManager] 激活plane1面板");
|
||
plane1.SetActive(true);
|
||
}
|
||
else
|
||
{
|
||
Debug.Log("[InventoryMaterialQueryReportManager] 激活plane2面板");
|
||
plane2.SetActive(true);
|
||
}
|
||
|
||
|
||
TutorialGuideManager.Instance.TriggerNextGuide(_button.name);
|
||
}
|
||
}
|
||
}
|
||
} |