122 lines
4.2 KiB
C#
122 lines
4.2 KiB
C#
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);
|
||
});
|
||
}
|
||
} |