Test-TaizhouWarehousePhaseII/3d/Assets/Zion/Scripts/ERP/到货验收/CheckApprovalStatusDemand.cs

122 lines
4.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections;
using System.Collections.Generic;
using DefaultNamespace;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using static InterfaceManager;
using DefaultNamespace.ProcessMode;
using Framework.Manager;
using MotionFramework;
/// <summary>
/// 查询需求计划审批状态
/// </summary>
public class CheckApprovalStatusDemand : MonoBehaviour
{
public TMP_InputField startDate;
public TMP_InputField endDate;
/// <summary>
///
/// </summary>
public Button BtnFindCheckApprovalStatusDemand;
/// <summary>
/// 工厂
/// </summary>
public TMP_InputField FactoryCheckApprovalStatusDemand;
/// <summary>
/// 计划批次
/// </summary>
public TMP_InputField PlanBatchCheckApprovalStatusDemand;
/// <summary>
/// 采购申请号
/// </summary>
public TMP_InputField PurchaseApplicationCheckApprovalStatusDemand;
/// <summary>
/// Panel2
/// </summary>
public Transform CheckApprovalStatusDemandPanelTwo;
/// <summary>
/// 答题卡
/// </summary>
public GameObject AnswerSheet;
public TMP_Dropdown[] ;
public TMP_Dropdown[] ;
public Button saveBt;
public Button saveBt2;
void Start()
{
saveBt2.onClick.AddListener(delegate
{
FileComponent.DownloadSingleFile("附件2需求计划审批状态反馈_答题卡1");
FileComponent.DownloadSingleFile("附件1需求计划审批状态查询情况报表");
MotionEngine.GetModule<ProcessManager>().HandleClick("保存");
});
BtnFindCheckApprovalStatusDemand = FindObjectByName<Button>("BtnFindCheckApprovalStatusDemand");
FactoryCheckApprovalStatusDemand = FindObjectByName<TMP_InputField>("FactoryCheckApprovalStatusDemand");
PlanBatchCheckApprovalStatusDemand = FindObjectByName<TMP_InputField>("PlanBatchCheckApprovalStatusDemand");
PurchaseApplicationCheckApprovalStatusDemand = FindObjectByName<TMP_InputField>("PurchaseApplicationCheckApprovalStatusDemand");
CheckApprovalStatusDemandPanelTwo = FindObjectByName<Transform>("CheckApprovalStatusDemandPanelTwo");
if (BtnFindCheckApprovalStatusDemand != null && FactoryCheckApprovalStatusDemand != null && PlanBatchCheckApprovalStatusDemand != null && PurchaseApplicationCheckApprovalStatusDemand != null)
{
BtnFindCheckApprovalStatusDemand.onClick.AddListener(() =>
{
List<string> list = new List<string>();
list.Add(startDate.text);
list.Add(endDate.text);
list.Add(FactoryCheckApprovalStatusDemand.text);
list.Add(PlanBatchCheckApprovalStatusDemand.text);
list.Add(PurchaseApplicationCheckApprovalStatusDemand.text);
// 你可以在这里调用其他方法来处理订单号
bool isTrue = MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(list);
if (CheckApprovalStatusDemandPanelTwo)
{
CheckApprovalStatusDemandPanelTwo.gameObject.SetActive(isTrue);
TutorialGuideManager.Instance.TriggerNextGuide(BtnFindCheckApprovalStatusDemand.name);
}
else
{
AnswerSheet.SetActive(true);
}
});
}
saveBt.onClick.AddListener(delegate
{
List<string> list = new List<string>();
// 遍历前 7 个元素
for (int i = 0; i < 7; i++)
{
if (i < .Length && [i].options.Count > [i].value)
{
list.Add([i].options[[i].value].text);
}
if (i < .Length && [i].options.Count > [i].value)
{
list.Add([i].options[[i].value].text);
}
}
// 移除未使用的变量,直接调用方法
MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(list);
});
}
}