Tz2/Assets/Zion/Scripts/单据/CustodyofMaterialWarehousin...

218 lines
7.5 KiB
C#

using DefaultNamespace.ProcessMode;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using static InterfaceManager;
/// <summary>
/// 代保管物资仓储单
/// </summary>
public class CustodyofMaterialWarehousingOrders : MonoBehaviour
{
/// <summary>
/// 页面1仓储单号
/// </summary>
[Header("页面1仓储单号")]
public InputField StorageOrders;
/// <summary>
/// 页面1工厂
/// </summary>
[Header("页面1工厂")]
public InputField Factory;
/// <summary>
/// 页面1地点
/// </summary>
[Header("页面1地点")]
public InputField Point;
/// <summary>
/// 页面1移动类型
/// </summary>
[Header("页面1移动类型")]
public InputField MoveType;
/// <summary>
/// 页面1物料编码
/// </summary>
[Header("页面1物料编码")]
public InputField materrialcode;
/// <summary>
/// 页面1批次
/// </summary>
[Header("页面1批次")]
public InputField Bathch;
/// <summary>
/// 页面1查询按钮
/// </summary>
[Header("页面1查询按钮")]
public Button Selectbt;
/// <summary>
/// 页面2工厂
/// </summary>
[Header("页面2工厂")]
public Text Panel2Factory;
/// <summary>
/// 页面2库存地点
/// </summary>
[Header("页面2库存地点")]
public Text Panel2Point;
/// <summary>
/// 页面2库存地点描述
/// </summary>
[Header("页面2库存地点描述")]
public Text Panel2PointMessage;
/// <summary>
/// 页面2物料编码
/// </summary>
[Header("页面2物料编码")]
public Text Panel2materrialcode;
/// <summary>
/// 页面2物料描述
/// </summary>
[Header("页面2物料描述")]
public Text Panel2materrialMessage;
/// <summary>
/// 页面2批次
/// </summary>
[Header("页面2批次")]
public Text Panel2Bathch;
/// <summary>
/// 页面2计量单位
/// </summary>
[Header("页面2计量单位")]
public Text Panel2Unit;
/// <summary>
/// 页面2数量
/// </summary>
[Header("页面2数量")]
public Text Panel2Num;
/// <summary>
/// 页面2移动类型
/// </summary>
[Header("页面2移动类型")]
public Text Panel2MoveType;
/// <summary>
/// 页面2选择完成打印按钮
/// </summary>
[Header("页面2选择完成打印按钮")]
public Button Panel2overprint;
/// <summary>
/// 页面2勾选完成打印按钮
/// </summary>
[Header("页面2勾选完成打印按钮")]
public Button Panel2print;
/// <summary>
/// 页面2选择Toggle
/// </summary>
[Header("页面2选择Toggle")]
public Toggle Panel2choose;
/// <summary>
/// 页面2
/// </summary>
[Header("页面2")]
public GameObject Panel2;
/// <summary>
/// 打印面板
/// </summary>
[Header("打印面板")]
public GameObject PrintPanel;
/// <summary>
/// 打印面板完毕面板
/// </summary>
[Header("打印面板完毕面板")]
public GameObject PrintPanelover;
void Start()
{
//StorageOrders = FindObjectByName<InputField>("代保管物资仓储单_仓储单号");
//Factory = FindObjectByName<InputField>("代保管物资仓储单_工厂");
//Point = FindObjectByName<InputField>("代保管物资仓储单_地点");
//MoveType = FindObjectByName<InputField>("代保管物资仓储单_移动类型");
//materrialcode = FindObjectByName<InputField>("代保管物资仓储单_物料");
//Bathch = FindObjectByName<InputField>("代保管物资仓储单_批次");
//Selectbt = FindObjectByName<Button>("代保管物资仓储单_查询");
//Panel2Factory = FindObjectByName<Text>("代保管物资仓储单_页面2工厂");
//Panel2Point = FindObjectByName<Text>("代保管物资仓储单_页面2库存地");
//Panel2PointMessage = FindObjectByName<Text>("代保管物资仓储单_页面2库存地描述");
//Panel2materrialcode = FindObjectByName<Text>("代保管物资仓储单_页面2物料编码");
//Panel2materrialMessage = FindObjectByName<Text>("代保管物资仓储单_页面2物料描述");
//Panel2choose = FindObjectByName<Toggle>("代保管物资仓储单_页面2选择");
//Panel2Bathch = FindObjectByName<Text>("代保管物资仓储单_页面2批次");
//Panel2Unit = FindObjectByName<Text>("代保管物资仓储单_页面2计量单位");
//Panel2Num = FindObjectByName<Text>("代保管物资仓储单_页面2数量");
//Panel2MoveType = FindObjectByName<Text>("代保管物资仓储单_页面2移动类型");
//Panel2print = FindObjectByName<Button>("代保管物资仓储单_页面2打印");
//Panel2overprint = FindObjectByName<Button>("代保管物资仓储单生成完成_打印");
//Panel2 = FindObjectByName<Transform>("代保管物资仓储单_Panel2").gameObject;
//PrintPanel = FindObjectByName<Transform>("代保管物资仓储单_页面2打印页面").gameObject;
//PrintPanelover = FindObjectByName<Transform>("代保管物资仓储单_页面2打印完毕").gameObject;
Panel2choose.onValueChanged.AddListener((a) =>
{
if (Panel2choose.isOn)
{
LoadTriggerNextGuide();
}
});
Selectbt.onClick.AddListener(() =>
{
List<string> answer = new List<string>();
answer.Add(Factory.text);
answer.Add(Point.text);
answer.Add(Bathch.text);
answer.Add(MoveType.text);
if (MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(answer))
{
Panel2.SetActive(true);
LoadTriggerNextGuide();
// if (IsRight)
// {
// }
}
});
Panel2overprint.onClick.AddListener(() =>
{
List<string> answer = new List<string>();
answer.Add(Panel2choose.isOn.ToString().ToLower());
if (MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(answer))
{
PrintPanel.gameObject.SetActive(true);
LoadTriggerNextGuide();
// if (IsRight)
// {
// }
}
});
Panel2print.onClick.AddListener(() =>
{
List<string> answer = new List<string>();
answer.Add("打印退料单");
if (MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(answer))
{
DocumentManagement.Instance.documentCollections[2].isShow = true;
LoadTriggerNextGuide();
// if (IsRight)
// {
// }
}
});
Init();
}
void Update()
{
}
void Init()
{
CombinedClass combined = GameManager.Instance.combinedClass;
Panel2Factory.text = combined.FactoryCode;
Panel2Point.text = combined.StockLocationCode;
Panel2PointMessage.text = combined.StockLocationName;
Panel2materrialcode.text = combined.materialCode;
Panel2materrialMessage.text = combined.materialName;
Panel2Bathch.text = combined.BatchNumber;
Panel2Unit.text = GameManager.Instance.unit;
Panel2Num.text = GameManager.Instance.marteialnumber.ToString();
Panel2MoveType.text = "X04";
}
}