465 lines
13 KiB
C#
465 lines
13 KiB
C#
using DefaultNamespace;
|
|
using DefaultNamespace.ProcessMode;
|
|
using MotionFramework;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using ZTools;
|
|
using static InterfaceManager;
|
|
|
|
/// <summary>
|
|
/// m查询物资采购合同执行状态
|
|
/// </summary>
|
|
public class QueryExecutionStatusMaterial : MonoBehaviour
|
|
{
|
|
[Header("mSAP上下架功能")]
|
|
|
|
#region mSAP上下架功能
|
|
|
|
/// <summary>
|
|
/// 日历组件
|
|
/// </summary>
|
|
public ZCalendarDemo zCalendarDemo;
|
|
|
|
/// <summary>
|
|
/// 日历按钮
|
|
/// </summary>
|
|
public Button btnQueryStart;
|
|
|
|
/// <summary>
|
|
/// 日历按钮
|
|
/// </summary>
|
|
public Button btnQueryEnd;
|
|
|
|
/// <summary>
|
|
/// 仓库号
|
|
/// </summary>
|
|
public InputField inputWarehouse;
|
|
|
|
/// <summary>
|
|
/// 物料编码
|
|
/// </summary>
|
|
public InputField inputMaterialCode;
|
|
|
|
/// <summary>
|
|
/// 批次
|
|
/// </summary>
|
|
public InputField inputMaterialBatch;
|
|
|
|
/// <summary>
|
|
/// 物料凭证
|
|
/// </summary>
|
|
public InputField inputMaterialVoucher;
|
|
|
|
/// <summary>
|
|
/// 凭证日期从
|
|
/// </summary>
|
|
public InputField inputStart;
|
|
|
|
/// <summary>
|
|
/// 凭证日期至
|
|
/// </summary>
|
|
public InputField inputEnd;
|
|
|
|
/// <summary>
|
|
/// 上架
|
|
/// </summary>
|
|
public Toggle toggleOnShelf;
|
|
|
|
/// <summary>
|
|
/// 下架
|
|
/// </summary>
|
|
public Toggle toggleOffShelf;
|
|
|
|
/// <summary>
|
|
/// 查询按钮
|
|
/// </summary>
|
|
public Button btnQuery;
|
|
|
|
#endregion
|
|
|
|
[Header("m仓库上下架管理")]
|
|
|
|
#region m仓库上下架管理
|
|
|
|
/// <summary>
|
|
/// 仓库上下架管理
|
|
/// </summary>
|
|
public Transform warehouseTransform;
|
|
|
|
/// <summary>
|
|
/// 行项目
|
|
/// </summary>
|
|
public List<InputField> inputERPDeliveryLists;
|
|
|
|
/// <summary>
|
|
/// 选择
|
|
/// </summary>
|
|
public Toggle toggleERPDeliveryLists;
|
|
|
|
/// <summary>
|
|
/// 黄条
|
|
/// </summary>
|
|
public GameObject yellowTicket;
|
|
|
|
/// <summary>
|
|
/// 状态
|
|
/// </summary>
|
|
public GameObject status;
|
|
|
|
/// <summary>
|
|
/// 分配仓位
|
|
/// </summary>
|
|
public Button btnAllocatePosition;
|
|
|
|
/// <summary>
|
|
/// 生成转储单
|
|
/// </summary>
|
|
public Button btnGenerateTransferOrder;
|
|
|
|
#endregion
|
|
|
|
[Header("m分配仓位")]
|
|
|
|
#region m分配仓位
|
|
|
|
/// <summary>
|
|
/// m分配仓位
|
|
/// </summary>
|
|
public Transform mTransformPosition;
|
|
|
|
/// <summary>
|
|
/// 数量
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_Quantity;
|
|
|
|
/// <summary>
|
|
/// 未清数量
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_UnClearQuantity;
|
|
|
|
/// <summary>
|
|
/// 单位
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_Unit;
|
|
|
|
/// <summary>
|
|
/// 仓库号
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_Warehouse;
|
|
|
|
/// <summary>
|
|
/// 物料编码
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_MaterialCode;
|
|
|
|
/// <summary>
|
|
/// 物料名称
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_MaterialName;
|
|
|
|
/// <summary>
|
|
/// 特殊库存
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_SpecialStock;
|
|
|
|
/// <summary>
|
|
/// 工厂/库存地点
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_FactoryLocation;
|
|
|
|
/// <summary>
|
|
/// 批次
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_Batch;
|
|
|
|
/// <summary>
|
|
/// 目标仓位
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_TargetPosition;
|
|
|
|
/// <summary>
|
|
/// 数量
|
|
/// </summary>
|
|
public TMP_InputField inputERPDeliveryLists_QuantityTwo;
|
|
|
|
/// <summary>
|
|
/// 保存
|
|
/// </summary>
|
|
public Button btnSave;
|
|
|
|
/// <summary>
|
|
/// 确定
|
|
/// </summary>
|
|
public Button btnConfirm;
|
|
|
|
/// <summary>
|
|
/// 成功
|
|
/// </summary>
|
|
public GameObject success;
|
|
|
|
#endregion
|
|
|
|
#region
|
|
|
|
/// <summary>
|
|
/// 返回信息
|
|
/// </summary>
|
|
public InputField returnmessage;
|
|
|
|
/// <summary>
|
|
/// 转储单号
|
|
/// </summary>
|
|
public InputField order;
|
|
|
|
/// <summary>
|
|
/// 工厂
|
|
/// </summary>
|
|
public InputField factory;
|
|
|
|
/// <summary>
|
|
/// 仓库号
|
|
/// </summary>
|
|
public InputField locationorder;
|
|
|
|
/// <summary>
|
|
/// 入库日期
|
|
/// </summary>
|
|
public InputField indata;
|
|
|
|
/// <summary>
|
|
/// 物料编码
|
|
/// </summary>
|
|
public InputField material;
|
|
|
|
/// <summary>
|
|
/// 目标仓位
|
|
/// </summary>
|
|
public InputField targlocal;
|
|
|
|
/// <summary>
|
|
/// 上下架数量
|
|
/// </summary>
|
|
public InputField outnumber;
|
|
|
|
/// <summary>
|
|
/// 物料描述
|
|
/// </summary>
|
|
public InputField matrialmessage;
|
|
|
|
/// <summary>
|
|
/// 批次
|
|
/// </summary>
|
|
public InputField Bathch;
|
|
|
|
#endregion
|
|
|
|
bool isclicklocatePosition = false;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
targlocal.text = "";
|
|
outnumber.text = "";
|
|
Init();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 生成转储信息
|
|
/// </summary>
|
|
private void SetMessage()
|
|
{
|
|
returnmessage.text = "转储运单0200223484生成成功";
|
|
order.text = "0200223484";
|
|
locationorder.text = "HA1";
|
|
}
|
|
|
|
private void Init()
|
|
{
|
|
// 查找场景中ZCalendarDemo组件
|
|
if (zCalendarDemo == null)
|
|
zCalendarDemo = FindObjectOfType<ZCalendarDemo>();
|
|
if (btnQueryStart != null)
|
|
{
|
|
btnQueryStart.onClick.AddListener(() => { InputDate(inputStart); });
|
|
}
|
|
|
|
if (btnQueryEnd != null)
|
|
{
|
|
btnQueryEnd.onClick.AddListener((() => { InputDate(inputEnd); }));
|
|
}
|
|
|
|
if (btnQuery != null)
|
|
{
|
|
btnQuery.onClick.AddListener(() =>
|
|
{
|
|
string onShelf = toggleOnShelf.isOn ? "true" : "false";
|
|
string offShelf = toggleOffShelf.isOn ? "true" : "false";
|
|
List<string> inputList = new List<string>();
|
|
inputList.Add(inputWarehouse.text);
|
|
inputList.Add(inputMaterialCode.text);
|
|
inputList.Add(inputMaterialBatch.text);
|
|
inputList.Add(inputMaterialVoucher.text);
|
|
inputList.Add(inputStart.text);
|
|
inputList.Add(inputEnd.text);
|
|
inputList.Add(onShelf);
|
|
inputList.Add(offShelf);
|
|
if (MotionFramework.MotionEngine.GetModule<ProcessManager>()._currentMode == ProcessMode.教学模式 ||
|
|
MotionFramework.MotionEngine.GetModule<ProcessManager>()._currentMode == ProcessMode.课程预览)
|
|
{
|
|
if (MotionEngine.GetModule<ProcessManager>().HandleClick(inputList))
|
|
Query();
|
|
}
|
|
else
|
|
{
|
|
MotionEngine.GetModule<ProcessManager>().HandleClick(inputList);
|
|
Query();
|
|
}
|
|
});
|
|
}
|
|
|
|
if (toggleERPDeliveryLists != null)
|
|
{
|
|
toggleERPDeliveryLists.onValueChanged.AddListener((bool value) => { yellowTicket.SetActive(value); });
|
|
}
|
|
|
|
//分配仓位
|
|
if (btnAllocatePosition != null)
|
|
{
|
|
btnAllocatePosition.onClick.AddListener(() =>
|
|
{
|
|
if (toggleERPDeliveryLists.isOn)
|
|
{
|
|
AllocatePosition();
|
|
LoadTriggerNextGuide();
|
|
}
|
|
});
|
|
}
|
|
|
|
//生成转储单
|
|
if (btnGenerateTransferOrder != null)
|
|
{
|
|
btnGenerateTransferOrder.onClick.AddListener(() =>
|
|
{
|
|
string onShelf = toggleERPDeliveryLists.isOn ? "true" : "false";
|
|
bool isMatch = MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(new List<string> { onShelf, inputERPDeliveryLists[7].text, inputERPDeliveryLists[9].text });
|
|
status.SetActive(true);
|
|
SetMessage();
|
|
LoadTriggerNextGuide();
|
|
});
|
|
}
|
|
|
|
//保存
|
|
if (btnSave != null)
|
|
{
|
|
btnSave.onClick.AddListener(() =>
|
|
{
|
|
bool isMatch = MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(new List<string> { inputERPDeliveryLists_TargetPosition.text, inputERPDeliveryLists_QuantityTwo.text });
|
|
inputERPDeliveryLists[7].text = inputERPDeliveryLists_TargetPosition.text;
|
|
inputERPDeliveryLists[8].text = inputERPDeliveryLists_QuantityTwo.text;
|
|
success.SetActive(true);
|
|
LoadTriggerNextGuide();
|
|
targlocal.text = MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("上架仓位");
|
|
outnumber.text = GameManager.Instance.marteialnumber.ToString();
|
|
mTransformPosition.gameObject.SetActive(false);
|
|
});
|
|
}
|
|
|
|
//确定
|
|
//if (btnConfirm != null)
|
|
//{
|
|
// btnConfirm.onClick.AddListener(() =>
|
|
// {
|
|
// mTransformPosition.gameObject.SetActive(false);
|
|
// LoadTriggerNextGuide();
|
|
// });
|
|
//}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询 DA1 2024.07.15 2024.07.15
|
|
/// </summary>
|
|
private void Query()
|
|
{
|
|
warehouseTransform.gameObject.SetActive(true);
|
|
CombinedClass combinedClass = GameManager.Instance.combinedClass;
|
|
if (combinedClass != null && inputERPDeliveryLists.Count >= 14)
|
|
{
|
|
inputERPDeliveryLists[0].text = combinedClass.FactoryCode;
|
|
inputERPDeliveryLists[1].text = combinedClass.WarehouseNumber;
|
|
inputERPDeliveryLists[2].text = combinedClass.DeliveryDate;
|
|
inputERPDeliveryLists[3].text = combinedClass.BatchNumber;
|
|
inputERPDeliveryLists[4].text = combinedClass.TransportationTypeDescription;
|
|
inputERPDeliveryLists[5].text = combinedClass.materialCode;
|
|
inputERPDeliveryLists[6].text = combinedClass.SourceLocation;
|
|
//inputERPDeliveryLists[7].text = combinedClass.TargetLocation;
|
|
//inputERPDeliveryLists[8].text = combinedClass.Quantity.ToString();
|
|
//inputERPDeliveryLists[10].text = combinedClass.materialUnit;
|
|
inputERPDeliveryLists[9].text = combinedClass.incomeQuantity;
|
|
//inputERPDeliveryLists[10].text = combinedClass.materialUnit;
|
|
inputERPDeliveryLists[11].text = combinedClass.materialVoucherNumber;
|
|
inputERPDeliveryLists[12].text = combinedClass.materialName;
|
|
//inputERPDeliveryLists[13].text = combinedClass.SpecialStockType;
|
|
//inputERPDeliveryLists[14].text = combinedClass.SpecialStockNumber;
|
|
}
|
|
|
|
LoadTriggerNextGuide();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分配仓位 生成转储单
|
|
/// </summary>
|
|
private void AllocatePosition()
|
|
{
|
|
CombinedClass combinedClass = GameManager.Instance.combinedClass;
|
|
if (combinedClass != null)
|
|
{
|
|
inputERPDeliveryLists_Quantity.text = combinedClass.incomeQuantity;
|
|
inputERPDeliveryLists_UnClearQuantity.text = combinedClass.incomeQuantity;
|
|
inputERPDeliveryLists_Unit.text = combinedClass.materialUnit;
|
|
inputERPDeliveryLists_Warehouse.text = combinedClass.WarehouseNumber;
|
|
inputERPDeliveryLists_MaterialCode.text = combinedClass.materialCode;
|
|
inputERPDeliveryLists_MaterialName.text = combinedClass.materialName;
|
|
//inputERPDeliveryLists_SpecialStock.text = combinedClass.specialStockNumber;
|
|
inputERPDeliveryLists_FactoryLocation.text = combinedClass.FactoryCode + "/" + combinedClass.StockLocationCode;
|
|
inputERPDeliveryLists_Batch.text = combinedClass.BatchNumber;
|
|
}
|
|
|
|
mTransformPosition.gameObject.SetActive(true);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 输入日期
|
|
/// </summary>
|
|
/// <param name="inputField"></param>
|
|
public void InputDate(InputField inputField)
|
|
{
|
|
// 检查是否找到了ZCalendarDemo组件
|
|
if (zCalendarDemo == null)
|
|
{
|
|
Debug.LogError("未在场景中找到ZCalendarDemo组件");
|
|
}
|
|
else
|
|
{
|
|
//zCalendarDemo.onConfirm += InputDate();
|
|
zCalendarDemo.show(inputField);
|
|
}
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
factory.text = MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("工厂代码");
|
|
indata.text = MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("日期为");
|
|
material.text = MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("物料编码");
|
|
matrialmessage.text = MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("物料描述");
|
|
Bathch.text = MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("批次");
|
|
inputERPDeliveryLists[10].text = GameManager.Instance.unit;
|
|
inputERPDeliveryLists_Unit.text = GameManager.Instance.unit;
|
|
inputERPDeliveryLists_MaterialCode.text=MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("物料编码");
|
|
inputERPDeliveryLists_MaterialName.text=MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("物料描述");
|
|
inputERPDeliveryLists_Quantity.text=GameManager.Instance.marteialnumber.ToString();
|
|
|
|
}
|
|
} |