278 lines
8.9 KiB
C#
278 lines
8.9 KiB
C#
using DefaultNamespace;
|
|
using DefaultNamespace.ProcessMode;
|
|
using MotionFramework;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using static InterfaceManager;
|
|
/// <summary>
|
|
/// ERP 维护货物交接单
|
|
/// </summary>
|
|
public class ERPMaintainGoodsHandoverForm : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 货物交接单号
|
|
/// </summary>
|
|
//public string deliveryListNumber;
|
|
#region UI控件
|
|
/// <summary>
|
|
/// 货物交接单
|
|
/// </summary>
|
|
public InputField input_DeliveryList;
|
|
/// <summary>
|
|
/// 查询按钮
|
|
/// </summary>
|
|
public Button btn_Query;
|
|
/// <summary>
|
|
/// 过账按钮
|
|
/// </summary>
|
|
public Button btn_Post;
|
|
/// <summary>
|
|
/// 确认
|
|
/// </summary>
|
|
public Button btn_Confirm;
|
|
/// <summary>
|
|
/// 过账面板
|
|
/// </summary>
|
|
public Transform panel_Post;
|
|
/// <summary>
|
|
/// 发货方
|
|
/// </summary>
|
|
public InputField input_Shipper;
|
|
/// <summary>
|
|
/// 收货方
|
|
/// </summary>
|
|
public InputField input_ReceivingParty;
|
|
/// <summary>
|
|
/// 合同编号
|
|
/// </summary>
|
|
public InputField input_ContractNumber;
|
|
/// <summary>
|
|
/// 供应商名称
|
|
/// </summary>
|
|
public InputField input_SupplierName;
|
|
/// <summary>
|
|
/// 实际交货期
|
|
/// </summary>
|
|
public InputField input_ActualDeliveryDate;
|
|
/// <summary>
|
|
/// 发货方时间
|
|
/// </summary>
|
|
public InputField input_ShipperDate;
|
|
/// <summary>
|
|
/// 收货方时间
|
|
/// </summary>
|
|
public InputField input_ReceivingPartyDate;
|
|
/// <summary>
|
|
/// 库存地点 TMPro
|
|
/// </summary>
|
|
public TMP_InputField input_StorageLocation;
|
|
|
|
/// <summary>
|
|
/// 查询显示
|
|
/// </summary>
|
|
public List<Transform> panel_QueryShow;
|
|
/// <summary>
|
|
/// 明细数据
|
|
/// </summary>
|
|
public List<TMP_InputField> input_ERPDeliveryLists;
|
|
/// <summary>
|
|
/// 货物交接单号
|
|
/// </summary>
|
|
public TMP_InputField input_DeliveryListNumber;
|
|
/// <summary>
|
|
/// 物料编码
|
|
/// </summary>
|
|
public TMP_InputField input_MaterialCode;
|
|
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// 验证数据
|
|
/// </summary>
|
|
//public DeliveryList eRPDeliveryListMain;
|
|
/// <summary>
|
|
/// 货物交接单验证数据
|
|
/// </summary>
|
|
public string str_DeliveryList;
|
|
|
|
#region 高亮提示
|
|
/// <summary>
|
|
/// 货物交接单高亮引导
|
|
/// </summary>
|
|
public Transform hightObjDeliveryListQuery;
|
|
/// <summary>
|
|
/// 发货人输入高亮提示
|
|
/// </summary>
|
|
public Transform hightObjShipperMaintainGoods;
|
|
/// <summary>
|
|
/// 收货人输入高亮提示
|
|
/// </summary>
|
|
public Transform hightObjReceivingPartyMaintainGoods;
|
|
/// <summary>
|
|
/// 库存地点输入高亮提示
|
|
/// </summary>
|
|
public Transform hightObjStorageLocationMaintainGoods;
|
|
#endregion
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
Init();
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
private void Init()
|
|
{
|
|
//初始化UI
|
|
if (btn_Query != null)
|
|
{
|
|
btn_Query.onClick.AddListener(() =>
|
|
{
|
|
// if (input_DeliveryList != null &&
|
|
// MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(input_DeliveryList.text))//查询
|
|
// {
|
|
// Query();
|
|
// }
|
|
// else
|
|
// {
|
|
// Debug.Log("货物交接单号不匹配或UI组件未正确初始化");
|
|
// }
|
|
|
|
|
|
if (input_DeliveryList != null
|
|
)//查询
|
|
{
|
|
MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(input_DeliveryList.text);
|
|
Query();
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("货物交接单号不匹配或UI组件未正确初始化");
|
|
}
|
|
|
|
});
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("btn_Query UI组件未正确初始化");
|
|
}
|
|
|
|
if (btn_Post != null)
|
|
{
|
|
btn_Post.onClick.AddListener(() =>
|
|
{
|
|
if (input_Shipper != null && input_ReceivingParty != null && input_StorageLocation != null)
|
|
{
|
|
if (MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(new List<string> { input_Shipper.text, input_ReceivingParty.text, input_StorageLocation.text }))
|
|
{
|
|
Post();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("eRPDeliveryListMain 或 UI组件未正确初始化");
|
|
}
|
|
});
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("btn_Post UI组件未正确初始化");
|
|
}
|
|
///确认按钮
|
|
btn_Confirm.onClick.AddListener(() =>
|
|
{
|
|
ResetUI();
|
|
});
|
|
|
|
//
|
|
hightObjDeliveryListQuery = FindObjectByName<Transform>("hightObjDeliveryListQuery");
|
|
hightObjShipperMaintainGoods = FindObjectByName<Transform>("hightObjShipperMaintainGoods");
|
|
hightObjReceivingPartyMaintainGoods = FindObjectByName<Transform>("hightObjReceivingPartyMaintainGoods");
|
|
hightObjStorageLocationMaintainGoods = FindObjectByName<Transform>("hightObjStorageLocationMaintainGoods");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询按钮点击事件
|
|
/// </summary>
|
|
public void Query()
|
|
{
|
|
for (int i = 0; i < panel_QueryShow.Count; i++)
|
|
{
|
|
panel_QueryShow[i].gameObject.SetActive(true);
|
|
}
|
|
CombinedClass combinedClass = GameManager.Instance.combinedClass;
|
|
input_ContractNumber.text = combinedClass.ContractNumber;//合同编号
|
|
input_SupplierName.text = "江苏南瑞帕威尔电气有限公司";//供应商名称
|
|
input_ActualDeliveryDate.text = "2025.03.04";//实际交货期
|
|
input_ShipperDate.text = combinedClass.FromPartyDeliveryDate;//发货方时间
|
|
input_ReceivingPartyDate.text = "2025.03.04";//收货方时间
|
|
//显示数据
|
|
input_ERPDeliveryLists[0].text = MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("物料编码");//物料编码
|
|
input_ERPDeliveryLists[1].text = MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("物料描述");//物料描述
|
|
input_ERPDeliveryLists[2].text = combinedClass.PurchaseVoucherNumber;//采购凭证号
|
|
input_ERPDeliveryLists[3].text = combinedClass.PurchaseVoucherItemNumber;//采购凭证子项号
|
|
input_ERPDeliveryLists[4].text = combinedClass.SupplyPlanNumber;//供应计划号
|
|
input_ERPDeliveryLists[5].text = combinedClass.CompanyCode;//公司代码
|
|
input_ERPDeliveryLists[6].text = "01D1";
|
|
input_ERPDeliveryLists[7].text = GameManager.Instance.marteialnumber.ToString();//数量
|
|
input_ERPDeliveryLists[8].text = GameManager.Instance.unit;//单位
|
|
input_ERPDeliveryLists[9].text = MotionEngine.GetModule<GlobalDataStorage>().GetTaskBookValueByMapping("批次");//批号
|
|
input_ERPDeliveryLists[10].text = combinedClass.goodsTransferNumber;//交货通知单号
|
|
hightObjDeliveryListQuery.gameObject.SetActive(false);
|
|
LoadTriggerNextGuide();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 过账按钮点击事件
|
|
/// </summary>
|
|
public void Post()
|
|
{
|
|
CombinedClass combinedClass = GameManager.Instance.combinedClass;
|
|
if (combinedClass != null)
|
|
{
|
|
input_DeliveryListNumber.text = combinedClass.goodsTransferNumber;
|
|
input_MaterialCode.text = combinedClass.materialCode;
|
|
panel_Post.gameObject.SetActive(true);
|
|
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("eRPDeliveryListMain 未正确初始化");
|
|
}
|
|
LoadTriggerNextGuide();
|
|
hightObjShipperMaintainGoods.gameObject.SetActive(false);
|
|
hightObjReceivingPartyMaintainGoods.gameObject.SetActive(false);
|
|
hightObjStorageLocationMaintainGoods.gameObject.SetActive(false);
|
|
}
|
|
|
|
//重置界面
|
|
public void ResetUI()
|
|
{
|
|
for (int i = 0; i < panel_QueryShow.Count; i++)
|
|
{
|
|
panel_QueryShow[i].gameObject.SetActive(false);
|
|
}
|
|
panel_Post.gameObject.SetActive(false);
|
|
input_DeliveryListNumber.text = "";
|
|
input_MaterialCode.text = "";
|
|
input_ActualDeliveryDate.text = "";
|
|
input_ShipperDate.text = "";
|
|
input_ReceivingPartyDate.text = "";
|
|
input_StorageLocation.text = "";
|
|
input_DeliveryList.text = "";
|
|
input_Shipper.text = "";
|
|
input_ReceivingParty.text = "";
|
|
for (int i = 0; i < input_ERPDeliveryLists.Count; i++)
|
|
{
|
|
input_ERPDeliveryLists[i].text = "";
|
|
}
|
|
}
|
|
}
|
|
|
|
|